# Rotary Axis CAM Scripts including Cylindrical Autoleveling

**URL:** <https://forum.avidcnc.com/t/rotary-axis-cam-scripts-including-cylindrical-autoleveling/1516>\
**Category:** General Chat\
**Tags:** rotary-axis\
**Created:** [January 1, 2023, 3:17am UTC](https://forum.avidcnc.com/t/rotary-axis-cam-scripts-including-cylindrical-autoleveling/1516 "2023-01-01T03:17:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![petermccloud](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.avidcnc.com/petermccloud/32/501_2.png) [@petermccloud](https://forum.avidcnc.com/u/petermccloud)\
**Post date:** [January 1, 2023, 3:17am UTC](https://forum.avidcnc.com/t/rotary-axis-cam-scripts-including-cylindrical-autoleveling/1516/1 "2023-01-01T03:17:03Z")

</div>

For those who have a rotary axis, I’ve just released an [open-source package of python scripts](https://github.com/mccloudaero/rotary_axis_cam_scripts) for making and modifying G-code for the Rotary Axis. This includes the probing and cylindrical auto-leveling techniques I’ve used to create the [isogrid cylinders I’ve posted about previously](https://forum.avidcnc.com/t/isogrid-cylinders/1266). They aren’t the most user friendly scripts yet, but I’m hoping that other might find them useful. Below is a list of the current scripts and functions.

EDIT: The output G-code will work with both Mach3 and Mach4, however, the probing functions require a macro. I’ve included a macro for Mach 4, but there isn’t one yet for Mach3.

- **Probing**
  - **pre\_probe\_cylinder.py** - Script to create a G-code file for probing a cylinder before machining
  - **pre\_probe\_cylinder\_edge.py** - Script to create a G-code file for probing a cylinder edge before machining
  - **pre\_probe\_cylinder\_plot.py** - Script for plotting pre-probe results
  - **probe.py** - Python module containing common probe functions

- **Create G-Code**
  - **cut\_groove\_cylinder.py** - Script to cut a groove (one tool width) into a cylindrical part. Can either be a constant depth or interpolates from a pre-probe file
  - **cut\_recess\_cylinder.py** - Script to cut a recess (greater than one tool width) into a cylindrical part. Can either use a constant depth or interpolates from a pre-probe file
  - **drill\_holes\_cylinder.py** - Script to drill holes circumfrentially around a cylinder at a specific X location

- **Modify G-Code**
  - **apply\_cylinder\_autolevel.py** - Reads in a G-code file, and writes out a new G-code file with cylinderical autoleveling applied
  - **convert\_to\_inverse\_time.py** - Take G-code using G94 feedrate and convert it to inverse time mode (G93)

---

<div class="post-metadata">

**Author:** ![da-kengineer-meister](https://avatars.discourse-cdn.com/v4/letter/d/f1d935/32.png) [@da-kengineer-meister](https://forum.avidcnc.com/u/da-kengineer-meister)\
**Post date:** [January 1, 2023, 3:28am UTC](https://forum.avidcnc.com/t/rotary-axis-cam-scripts-including-cylindrical-autoleveling/1516/2 "2023-01-01T03:28:09Z")

</div>

@petermccloud , thank you for sharing. Quick question: Does the inverse/reverse time piece(G94/G93) require Mach-4 to run or does that work with Mach-3 as well?

---

<div class="post-metadata">

**Author:** ![petermccloud](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.avidcnc.com/petermccloud/32/501_2.png) [@petermccloud](https://forum.avidcnc.com/u/petermccloud)\
**Post date:** [January 1, 2023, 3:44am UTC](https://forum.avidcnc.com/t/rotary-axis-cam-scripts-including-cylindrical-autoleveling/1516/3 "2023-01-01T03:44:41Z")

</div>

@da-kengineer-meister I don’t currently run Mach3, but looking at the [Mach3 G-code manual (last page)](https://machmotion.com/documentation/Software/Mach3/Mach3%20G-Code%20Manual.pdf), it does support inverse time mode (G93).
