Postprocessor for oscillating tangential knife

More
18 Feb 2026 19:00 - 27 Feb 2026 18:27 #343160 by TurboTux
Hi,
I've bought an oscillating tangential knife (Stepcraft OTK3) a few month ago but didn't found a linux post processor for it, So, I created one myself that should be generally usable because it does not contain any special features for my device. Probably, it may be useful for someone else,

It's written in C++ and can be easily created (needs g++ package on linux, compiling on Windows should be possible as well). Just extract the tgz into a subdirectory by
 tar xvzf OTKPP.tgz
Go into the directory and compile it with
 g++ OTKPP.cc -o OTKPP
alternatively just type
 make 

This should create the OTKPP executable. Copy it somewhere in your search path where it can be found by e.g. by your CAM program. It can also be called in the console For the file "engraving.ngc" you might call
  OTKPP -i engraving.ngc -o engraving_OTK.ngc
If no output option is specified, the result is printed to stdout.
  
There are some more options for example to change the OTK axis (default is C) or the max. angle for retraction. The available options are as follows (also printed if OTKPP is called without parameters):
  
  -a   --axis <axisname>   Name of the OTK axis e.g. A or C (default is C)
  -d     dwell <delay>     Delay time to run-up the oscillation (default 3 sec)
  -dbg --debug             Adds comments to the output about what's going on
  -f   --feed <speed>      Default z-feed (will be replaced by g-code if exists)
  -h   -? | --help         Prints the syntax and available options
  -i   --in <filename>     Path of the input gcode file 
  -l   --limit <angle>     Max. rotation without retraction (default 20°)
  -m   --modulo            Created rotation range [0..360)
  -o   --out <filename>    Path of the modified output gcode file
  -z   --zsafe <position>  Safe retraction height (default 2 machine units e.g. mm)

If the -dbg (or --debug) option is specified, the modifications are commented in the resulting code which should be still executable. The attached tgz also contains an example file (original and after processing)
  
It should be also possible to set up the OTKPP as post processr in your preferred CAM software in order to create the programs for the OTK directly. As I only use CamBam for Linux, here are the steps for the integration (sorry, I don't use Mach3/4 and thus, don't know how to set it up there).

1. Open the post processors settings in CamBam
2. Create a copy of your favorite post procesor (e.g. LinuxCNC -> LinuxCNC-OTK)
3. Add the following line in the "Post-Build Command" option:
    <Path_to_the_program>/OTKPP
4. Add your favorite arguments in the "Post-Build Command Arguments" option (e.g.):
     -dbg -a C -l 25 --in {$outfile} --out {$outfile}
5. Select the LinuxCNC-OTK post processor in the project's operation

Just one warning:
Please take care if your machine works with imperial units (inch), as the default retraction value is 2.0 which is equivalent to 2mm on my metric machine. Adjust the value in the code or by using the -z or --zsafe parameter if necessary. Nevertheless, it might be better to run a dry test anyway.

Feel free to adapt or modify it. If you have questions or run into problems just response.

Hope it helps,
Stefan
Attachments:
Last edit: 27 Feb 2026 18:27 by TurboTux. Reason: Fixed wrong formatting
The following user(s) said Thank You: tommylight

Please Log in or Create an account to join the conversation.

  • tommylight
  • tommylight's Avatar
  • Away
  • Moderator
  • Moderator
More
25 Feb 2026 23:12 #343508 by tommylight
Replied by tommylight on topic Postprocessor for oscillating tangential knife
Thank you.
I would also like to build one such machine, but i have a pretty long waiting list, building a laser and a router now, want to build a small but sturdy mill, a wire EDC, a bigger styrofoam cutter, a rugbot, a normal tangential knife, ... oh well.

Please Log in or Create an account to join the conversation.

More
27 Feb 2026 18:35 #343619 by TurboTux
Replied by TurboTux on topic Postprocessor for oscillating tangential knife
Hello,

that looks like a lot of work to do and I hope that the OTK-post processor will be
helpful for you as it just adds the rotation for the knife and, if necessary, the
retractions.
FYI: The stepcraft OTK-3 is a little bit "special", because it requires an unusual 30V power supply and I also had to build a small circuit to connect it to my homemade CNC router.(running at 48V) and to handle the homing and safety stop signals.
Just let me know if you encounter any problems with the post processor.. Maybe
I can fix or improve it.
The following user(s) said Thank You: tommylight

Please Log in or Create an account to join the conversation.

Time to create page: 0.062 seconds
Powered by Kunena Forum