Add gcode to the start of every program

i have just upgrdaded my 3018 spindle from 8000 RPM to 20000, and according to the manufacturer i am supposed to gradually build the speed up from 1000 to 10000, using gcode which i understand and have to add manualy every time i load a new gcode.

is there a way of automaticlly adding theses lines to the begining of any new gcode i load.
Using Cut2D Desktop and UGS


I wonder if you could create a Macro, a series of gcodes that you would press before you load your program? I have a Macro for my touch plate.

Universal Gcode sender - review and tutorial (

i had thought of that, but it wont really work as soon as the macro stops you are back to zero speed, and you have to stop the macro to load the new gcode.

If it is not possible with g-code then maybe you will have to do it manually.

For what’s its worth, I use a regular router, but what about a text file where you do a series of Gcode lines like this:

M3S1000, M3S2000…M3S20000…and just copy that into your program at the beginning. It would just be a copy and paste function.

There is this if you haven’t seen it.

Introduction to CNC for a Total Novice: Tuning GRBL Settings - SainSmart Resource Center