# G-code commands to rotate the A-axis by 90 degree?

I have a rotary installed. I would like to execute a four-sided Job.

I would use the regular post processor to cut the first side, a regular XYZ carve.
Then I would like to rotate the piece by 90 or 180 degrees.

To do that I would install the rotary processor, and swap the Y for the A cables.

What are the G-code commands to tell the A-axis to rotate by 90 or 180 degrees?

Did you solve this?.

I was thinking than an external much simoler ( not the buildbotics) controller could be used to turn a stepper motor 90 degrees and hold it there thus save changing the 1F wiring.

The external controller i imagine need only be a small microcontroller , driver, and a switch.

Anyone tried this?

You can use an Arduino to do this.
I have looked into it but have had my priorities somewhere else. Still hoping for the Masso upgrade, although the Arduino would solve most of my rotary problems.

It might even be better to run complex STL files as 4 four sided projects (manually turning 90 degrees with the Arduino) if you use VCarve, because VCarve’s 4 axis tool path are full of bugs.

1 Like

I am also waiting for the Masso upgrade - but that may be a long wait.

I’ll give this a go, thank you for the link

There is so much work involved, assembling the arduino, stepper motor driver, LCD, the wiring to the stepper motor and power supply.

Then the arduino need programming.

If you succeed and write down instructions there will be many very grateful people on this forum.

Hey Tom, hey Andy @AndyP, hey all,

While the BB Controller has 4 axes, it only has limited support for rotary motion. The ability to turn a specific number of degrees is not implemented. For rotary motion, you would have to configure it to think the angle traveled is actually a linear distance. For instance, for a metric program, you would configure the axis to move 360 degrees in one revolution. That way, when you tell it to move by 45 mm, it would turn by 45 degrees.

This would work until you tried to run a program that runs with imperial units. Then you would have to reconfigure the axis for 360 inches per revolution.

This can work pretty well if you just use your rotary axis to do rapid turns to a new position.

Another thing that is missing is the ability to maintain a constant feed rate as the distance from the center of rotation changes. In other words, the rotational speed needs to be slower as the distance from the center of rotation increases, otherwise the feed rate will increase and possibly mess up your cut.

We do plan to implement full support for rotary motion, but do not have it scheduled. You can track the status of this request on github at https://github.com/buildbotics/bbctrl-f … /issues/95 .

– Source: Re: 4-axis Upgrade – Buildbotics Forum by Doug

I got it to work today. I just had to adjust those values in the motor settings and used a modified post processor to wrap the Y axis to the A axis. Glad to see it working great.

– Source: Re: Rotary axis – Buildbotics Forum by rblur01

You could also ask Roger Treadway (@rblur01) directly, in his setup in Worth the Price? / Rotary Axis Setup he says that he sets ‘travel-per-rev’ to 360. He says there:

Change the axis from Y to A. Change your “travel-per-rev” to 360. This will have to be the case for all rotaries for our controller as it is. Change the “step-angle” to whatever is mentioned for your rotary, mine was stated to be 0.3 degrees.

– Source: Rotary Setup for Onefinity

See one of his results here

In this case a command like G0 A90 (after setting one of the axes to “A”) rotates it by 90 degrees.

If you want to use three linear XYZ axes and and an A rotary axis additionally, you might be interested in this: