This is a list of premade Macros for firmware 1.4.0 and up from Onefinity.
More info on the 1.4.0 firmware that introduced Macros:
How to install:
Click the macro you want to install from below. Place it on a usb stick like you would if you were going to run a file. Insert the usb drive into any port on the back of the BB controller. In the flyout menu, select MACROS. On the macro setting screen, click UPLOAD and choose the file you put on the pen drive. This will upload the code to that number macro you selected. Rename the macro in the name text box and choose a color from the color box to assign to the macro. Return to the control page and the macro should now be assigned.
another future feature idea i had was inside the macro editor to be able to checkmark which tools it applies to, eg, Laser Material Test macro isnāt useful when using the Router/Spindle, and Vaccum isnāt useful for Laser, etcā¦
I also wonder if a default GoHomeXYZ might benefit from first raising Z during travel, then lowering upon arrival. something like G0 G90 X0 Y0 Z75; G0 G90 Z0; to avoid the inevitable classic clamp in the way bit breaking scenario
I also wonder if there is a way to ātoggleā a value in cgode, eg. turn vac off/on on alternate presses of the same macro.
There exist two motion commands that first move to an intermediate coordinate, and only then to home or to an alternative position that youāve set as predefined position. This is useful if you just milled inside a deep pocket, which is impossible to leave in the shortest way, in this case this command allows you to first let the router reach a higher position as intermediate position, and only then move to the final target coordinate. This command is called G28 or G30, but in order to use it, you need to have recorded the target final position before (unless you want it to be home, which is the default target). On the command line, you only give the intermediate position. If you give a Z axis value here, that can be seen as a sort of āsafe heightā.
Letās assume that you have not set an alternative predefined position, in this case the default target position is the machineās home position. This command goes this way:
G28 Z0
This will first lift Z to its topmost position which is 0 (Z goes from 0 to ā133), and only then it will go to the predefined position (usually home position)
If you enter:
G91 G28 Z20
the prepended G91 (Set incremental distance mode) will make that value of the axis (here: 20) is interpreted as incremental value relative to the current position (instead of absolute machine value), so it would mean: āLift Z by 20 mm from the current position, then go to the predefined postion (usally home position)ā.
Cartesian coordinate system with right hand orientation
Schematic Representation of a CNC vertical milling center ā Source: Smid, Peter: CNC Programming Handbook , Industrial Press, South Norwalk, CT, USA, ISBN 9780831133474
@Aiph5u Iām so thankful for your wealth of knowledge, and generosity to share it! There is so much to learn, and i love learning. Iāll have to explore those commands further! Thank you.
I worked on this g-code last year sometime to easily find the middle of a workpiece by going to opposite corners and running the code. Now that MACROs exist, iām excited I can assign it to a macro button called āGo to Midpointā.
The g-code I figured out is
M70 ; Save modal states
G54 G91 G0 X[#5420/-2] Y[#5421/-2] ; go to half the distance between current location and origin
M72 ; Restore modal states
Iām not an expert, so by all means let me know if this can be improved!
I made a not-very concise video demoā¦
Iām also hoping I can figure out similar code to find the center of a circle based on three points on it.
@Aiph5u I appreciate the feedback! I did start with code that looked like that, but I think my g-code math works additionally to handle the case where the machine is at a negative location to the origin since dividing by the negative results in a positive relative move back toward the origin instead of away.
I did just learn about M70, M72 from your tool-change routine post, and I wrapped my MACRO in that too to make sure it doesnāt change any machine state. Thanks!
1 Like
Aiph5u
(Aiph5u (not affiliated with Onefinity))
11
I finally took the plunge and got the new firmware. Everything looks good. I installed a couple of the macros and they worked fine until I tried the journeyman park center macro. I got several soft limit errors. Machine was homed.
What is the code to set the working āhomeā position? I have a Vacuum table and want to set XY zero at
X4 Y3 in a macro.
Thanks!
Aiph5u
(Aiph5u (not affiliated with Onefinity))
14
Hey Tony,
the g-code command sequence
G53 G0 X4 Y3
moves rapidly to X=4 and Y=3 in machine coordinates (no matter what coordinate system is in effect). If you want to be at a safe height prior to it you would add a preceding line that says
G53 G0 Z0
which will lift Z to the upmost position.
If you want to make the X=4 Y=3 (to which you moved rapidly above) your new workpiece zero, finally you do:
G92 X0 Y0
From this moment on, your X=4, Y=3 is the new X=0, Y=0.
Alternatively, if you donāt want to move to the new position but only set it your new workpiece zero, if youāre still at home position (or use G28 Z0 to go home with first lifting Z), you can simply enter:
G92 X-4 Y-3
From this moment on, your X=4, Y=3 is the new X=0, Y=0.
IMPORTANT NOTE: Unlike the coordinate system commands G54āG59.3, G53 is not modal, it must be programmed on each line. G0 or G1 does not have to be programmed on the same line if one is currently active.
@Aiph5u Sorry long time no see,
Am just getting started with inlays and have a question about Z hgt.
Currently rough carve the plug with a 1/4 straight bit and start at Z0. Then detail carve with V bit starting with Z0 but have to run the detail carve again with Z-4, as the router cannot handle starting at V-4.
Would it be possible to write a macro so that when the Vbit gets to lets say Z-6 the program stops resets the Z start depth to Z-4 and starts the program from the beginning.
I am not ready yet to go into the detail cut code and re set the F command mid program.
PS wanted to PM you a note but for some reason I cannot seem to be able to.
Aiph5u
(Aiph5u (not affiliated with Onefinity))
16
Hey Tony,
I do not really understand what your problem is. If you have different passes with different bits, isnāt your CAM program dealing with the Z height correctly for the different passes?
It should be possible to send me PMs as others sometimes do. However when I try to send you a message, this is not possible. The error popup says: āSorry, ynot is not accepting messages at the momentā. Did you configure something on your forum account that prevents private messages?
Another question about macrosā¦ can they call a sub function/program that is in the Program Start field in Settings? They trigger code in this field to run but can they call a specific function (O word). This could solve my previous question above.
Update: I tried just calling O3000 (the name of my subroutine in the Program Start) and it didnt execute anything at first and then realized that I needed to have ācallā in there and it executed the subprogram.
The reason that I needed this is to have a series of subprograms that I am using for my ATC to open the dust cover that is using Load 2 (M08/M09) and to run a bit setter subprogram to get a new Z-offset.
I didnt want these programs called for every program start since the macros trigger the Program Start code and this is not desired for a handful of the macros that relate to laser and other non-ATC functions.
@OnefinityCNC
Is there a way to switch between Laser and Spindle/VFD with macros? Currently I have to go to the settings and into the tools menu to swap between the two. A macro to switch between the two would be awesome.
So I am not sure if I am missing something here but I have scoured the internet to find help with creating macros for my x50 journeyman and the new 1.4 firmware release.
When I turn on my machine and home it, my home position is x=0 y=0 and z=0.
From this point I can create a macro to send me anywhere on the tableā¦ no issues.
My issue starts once I set a zero position for my work piece. Once set, I can no longer move to specific locations on the table. I have tried the G90 (Absolute) and the G91 (Relative) settings, they move me from either the set zero position for the work piece or the current x,y position as they are intended to do.
What I am trying to do is move to a specific position based on the original home position (G28).
I am using imperial measurements and would like to go to the position X44 Y3 (where I usually change the bits - out of the way), no matter where I am on the table and wherever my work piece is zeroāed.
Is this possibleā¦ if not, why the macro capability?
I have run the journeyman macro supplied up-top (ParkRearRightJourneyman), if I run from my original home position X0 Y0 (G28), it runs fine, if I am anywhere else on the tableā¦ I get an error stating that I have exceeded my soft limits.
Do I have something set wrong, dod I need to add a G? code firstā¦ must be something like this as I am sure this is possible.