G33 equivalent with spindle end speed

Here is where you can request new features or special features.

G33 equivalent with spindle end speed

Postby D190979V » Wed Mar 15, 2023 3:05 pm

Hello, my name is Dominik,
I hope it´s ok to start my participation to this forum with a feature request.
Short introduction on my situation: In the last years I built several CNC machines controlled by various software and
controller configuations, mostly cartesian but also some parallel kinematic machines.
One of my first CNC projects was a lathe conversion to stepper motors and mach3.
Because of the compact size and therefore minimal rotating masses it turned out not that perfect because
of the mach3 single index pulse issue treading with reasonable/reliable passes was impossible and so the
project was abandoned for several years.
A few weeks ago I switched my larger router to UCCNC and recognized the sync modes with encoder support.

So I picked up the project again, made some more improvements to the lathe and first steps with UCCNC and turning.
Even there is no real lathe support, yet, I´m very happy with the first results.
Here´s a full time video of one of the first sample parts (I hope posting links is allowed):
https://www.youtube.com/watch?v=jWzxNC5xbAc&t=3s
The video is very long, if interested G33 thread cutting starts at Minute 4, but my problem and feature
request comes at the end around minute 8.

I also use the G33 for parting off here, which othervise is the most difficult operation, and normally on such a small
machine ends up with tool parted off, not part parted off because the circle of death then starts with slowing down spindel
upon tool contact, less speed same feed again lowering spindel speed... etc.
With G33 I have a constant cut depth and this works really well if spindle speed is increased in relation to the diameter decrease
(constant cutting speed). Doing this manually is possible but not very nice on a CNC.

So finally the question: Will there be a sync mode command similar to G33 but with two (or one) more parameters, lets name them SpeedStart
and (more important) SpeedEnd?

Sorry for the long post.

Best regards
Dominik

P.S.:

Othervise I currently see three possible workarounds:

1.) Splitting the cut off in several smaller segments with new Speed Commands in between.
This will result in an intermittent cut which is for some materials (some sorts of aluminium or steel)
no ideal but will be very easy by just using modified G-Code.

2.) Picking up the step and encoder signals with a custom made PCB and overwriting the speed output
of the controller, this seems to be a hazzle to set up between cuts and most likely will result in a
custom modbus spindle controller.

3.) Maybe a more or less simple macro is possible? Not sure if the the spindle speed can be maniplulated during a running sync
motion? Would it be possible to read the X Axis field and write/validate the Spindle Speed Field during a sync motion?
(Have not played with the macros, yet)
D190979V
 
Posts: 5
Joined: Wed Mar 15, 2023 12:16 pm

Re: G33 equivalent with spindle end speed

Postby D190979V » Wed Mar 15, 2023 9:46 pm

Hi again,
I did some macro testing and have found a turnaround, not nice but working:

Code: Select all
//M33 Macro for UCCNC
//Adjusting Speed for Lathe Usage
//Used via Macro Loop
//Internal Var #33 is holding cutting speed in m/min
//Var #34 and #35 will contain the radius for min and max speed (calculated by macro)
//Spindle rpm is calculated via toolpiece diameter aka two times X
//The spindle speed is adjusted by overriding
//So it has to be set to an initial value that can be scaled properly

double cuttingSpeed=exec.Getvar(33);
if(cuttingSpeed<=0)
{
   cuttingSpeed=50.0;
}
double minRpm=Double.Parse(AS3.Getfield(177));   //Spindle_Minvelocity
double minVelocityDiameter=(cuttingSpeed*1000.0)/(minRpm*Math.PI);
exec.Setvar(minVelocityDiameter/2.0,34);   
double maxRpm=Double.Parse(AS3.Getfield(178));   //Spindle_Maxvelocity
double maxVelocityDiameter=(cuttingSpeed*1000.0)/(maxRpm*Math.PI);
exec.Setvar(maxVelocityDiameter/2.0,35);      

double diameter=2.0*exec.GetXpos();
double rpm;


if(diameter>=minVelocityDiameter)
{
   rpm=minRpm;
}
else if(diameter<=maxVelocityDiameter)
{
   rpm=maxRpm;
}
else
{
   rpm=cuttingSpeed/(diameter*Math.PI)*1000.0;
}

double rpmSet=Double.Parse(AS3.Getfield(869));
AS3.Setfield(Math.Round((rpm/rpmSet)*100.0),233);   //SetspindlespeedOV
AS3.Validatefield(233);


Other trials that did not work or were very ugly:
Code: Select all
//Most ugly but working
//double rpmOvSet=Double.Parse(AS3.Getfield(2451));
//if(rpmOvSet<rpm)
//{
//   exec.Callbutton(134);
//}
//else if(rpmOvSet>rpm)
//{
//   exec.Callbutton(135);
//}

//Non working approaches
//Does not change output, only fields on screen
//AS3.Setfield(Math.Round(rpm),2451);   //Setspindlespeed
//AS3.Validatefield(2451);

//Does not change output, only fields on screen, seems also be problematic with speed value set internally not changed properly
//AS3.Setfield(Math.Round(rpm),869);   //Setspindlespeed
//AS3.Validatefield(869);

//Does not change output, only fields on screen
//AS3.Setfield(Math.Round(rpm),869);   //Setspindlespeed
//AS3.Validatefield(869);
//Even not after this
//exec.Callbutton(134);
//exec.Callbutton(558);   //Reset Feed rate ovverride to 100%

//Can not Work because controller is already executing the move and M106 is not handled parallel?
//exec.Code("M106 P"+Math.Round(256.0/maxRpm*rpm));
//exec.Code("S"+Math.Round(rpm));


Best regards
D190979V
 
Posts: 5
Joined: Wed Mar 15, 2023 12:16 pm

Re: G33 equivalent with spindle end speed

Postby cncdrive » Thu Mar 16, 2023 3:57 am

Hi Dominik,

I think you what you want to implement is called G96 constant surface speed spindle control mode.
What it does is it speeds the spindle up automatically as the knife runs closer to the center line of the workpiece, in other words when the diameter of the workpiece is smaller.
In G96 mode the spindle speed is automatically adjusted based on the X axis distance from 0 in a way that the surface speed is constant, so the chipload on the lathe knife remains constant.
G96 also has a speed limit parameter, because when the knife goes to 0 diameter then theoritically the spindle speed has to be infinite to keep the surface speed, but that is ofcourse not possible and in most applications you need to limit the spindle speed at a certain level to not break the tool.

G96 we already implemented for the UCCNC lathe mode, but it was not released yet.
cncdrive
Site Admin
 
Posts: 4741
Joined: Tue Aug 12, 2014 11:17 pm

Re: G33 equivalent with spindle end speed

Postby D190979V » Thu Mar 16, 2023 8:39 am

Hi,

yes, on most lathes the example above would be a G96.
(followed by a G95, where I used the G33, which is essentially the same).

Perfect that this has already been implemented.
I will keep UCCNC on this machine and stay curious for your lathe version.
Until then I can work with the turnaround macro.

Thank you for the information!
D190979V
 
Posts: 5
Joined: Wed Mar 15, 2023 12:16 pm


Return to Feature Request

Who is online

Users browsing this forum: No registered users and 2 guests