Page 1 of 3

Spindel Warm-Up Macro

PostPosted: Wed May 03, 2017 8:32 am
by BigAl
Hi there,

has anyone implemented a spindle warm-up macro in UCCNC. I know that it is a basic macro (M3 S### G4 P### and so on). My question is where and when to start this macro. My idea is to place a button on the start screen to invoke the warm-up sequence. But how ca I run the sequence and - if possible - stop the sequence while it's running. The warm-up sequence is also dependent on the actual temperature (spindle, surrounding).

I'm interested how other people have solved this in UCCNC.

Alex

Re: Spindel Warm-Up Macro

PostPosted: Wed May 03, 2017 9:54 am
by dezsoe
Alex,

In Configuration/Axis setup/Spindle you can configure delays for spin up and spin down. When M3 or M5 is executed in g-code, this delay will be inserted. When g-code is not running, you just press spindle start/stop on the Run screen, there will be no delay. Is this what you need?

Re: Spindel Warm-Up Macro

PostPosted: Fri May 05, 2017 6:20 am
by BigAl
Hi together,

with spindle warm-up I mean a program that perform e.g. the following sequence:

1. Run spindle with 6000 RPM for 5 minutes
2. Run spindle with 12000 RPM for 5 minutes
3. Run spindle with 18000 RPM for 5 minutes
4. Run spindle with (again) 6000 RPM for 1 minute

It's easy to make a macro that performs this steps. My problem is, that I get no status information about the running macro. The current step I can see by checking the actual speed. But the remaining time is also interesting. I think about writing the value for the remaining time to a variable and show that on the screen. I thought there is eventualy already a solution for this purpose because spindle warm-up is an essential thing for high speed spindles...

Alex

Re: Spindel Warm-Up Macro

PostPosted: Fri May 05, 2017 7:48 am
by A_Camera
Do you really think it is necessary? I mean if you feel you have a need to warm up the spindle you can just click and start the spindle and stop when you think it is done and ready. I think there is no point in creating a complicated warm-up sequence, but if you feel you need it why not just write a simple G-code manually and run that every time you want to warm it up. You can save that in a macro file and use a button to call that as macro code if you want, or run it directly with the M command from the MDI.

Re: Spindel Warm-Up Macro

PostPosted: Fri May 05, 2017 9:15 am
by BigAl
Ok, I've done it.

And YES, it's necessary, because I don't like to damage my 1400 Euro spindle.

I added a button to the screen (ID=20000) and a textfield (ID=20000). With the button I can start or interrupt the warm-up procedure. While the warm-up procedure is running the button for warm-up blinks and show me the remaining seconds of the current stage. Now I can leave my workshop while the spindle is warming up and drink a coffee :-)

The screen looks like this:

WarmUp.png
UCCNC-Screen with running warm-up


And the macro looks like this:

Code: Select all
//  Spindle Heat-Up

// stages for warm-up
const int Stages = 4;

double[] Speed = new double[Stages];
int[] Time = new int[Stages];

Speed[0] = 6000;
Time[0] = 300;

Speed[1] = 12000;
Time[1] = 300;

Speed[2] = 18000;
Time[2] = 240;

Speed[3] = 6000;
Time[3] = 60;

// Position for the warm-up procedure
double PosX = 0;
double PosY = 620;
double PosZ = 140;

if (AS3.Getbuttonstate(20000)) // if the warm-up is running already stop it
{
  // switch the state to "off"
  AS3.Switchbutton(false, 20000);
}
else // start heat-up
{
  // machine must be homed
  if(!exec.GetLED(56)||!exec.GetLED(57)||!exec.GetLED(58))
  {
    MessageBox.Show("The machine was not yet homed, home the machine before warm-up!");
    AS3.Setfieldtext("ERROR", 20000);

    // leave the macro
    exec.Stop();
    return;
  }

  // show init info
  AS3.Setfieldtext("INIT", 20000);

  // switch the state to "on"
  AS3.Switchbutton(true, 20000);

  // store the current distance mode
  int DistanceMode = exec.actualmodal;

  // wait until everything is stopped
  while(exec.IsMoving()){}

  // move the Z axis to the warm-up position
  exec.Code("G00 G53 Z"+ PosZ);
  while(exec.IsMoving()){}
  exec.Wait(200);

  // move the X and Y axis to the warm-up position
  exec.Code("G00 G53 X" + PosX +" Y" + PosY);
  while(exec.IsMoving()){}
  exec.Wait(200);

  // restore the original distance mode
  exec.Code("G" + DistanceMode);

  // perform the stages
  int Stage = 0;
  while (Stage < Stages)
  {
    // set the spindle speed
    exec.Code("S" + Speed[Stage]);

    // turn the spindle on
    exec.DospinCW();

    // wait
    int Secs = 0;
    while (Secs < Time[Stage])
    {
      exec.Wait(1000);
      Secs++;
      AS3.Setfieldtext((Time[Stage] - Secs).ToString(), 20000);

      // interrupt the warm-up?
      if (!AS3.Getbuttonstate(20000))
      {
        // stop the spindle
        exec.Stopspin();
        // show interrupt
        AS3.Setfieldtext("", 20000);
        // leave the macro
        exec.Stop();
        return;
      }
    }

    // next Stage
    Stage++;
  }

  // stop the spindle
  exec.Stopspin();

  // switch the state to "off"
  AS3.Switchbutton(false, 20000);
  AS3.Setfieldtext("OK", 20000);
}

Re: Spindel Warm-Up Macro

PostPosted: Fri May 05, 2017 10:44 am
by ger21
You could just run this?

S6000
M3
G4 P300000
S12000
G4 P300000
S18000
G4 P300000
S6000
G4 P60000
M5


Personally, I think that 1-2 minutes at 6000-8000 rpm is more than enough, unless the temperature is near freezing.

For 20 years, I've never warmed up our $10,000 spindles, and have not had any issues. Eben if I did warm them up, they'd be cooled back off within 5 minutes.
Do you run this once a day, or every time you use the machine?

Re: Spindel Warm-Up Macro

PostPosted: Fri May 05, 2017 7:34 pm
by BigAl
Hi Gerry,

this is an inital thing I will do before I use the machine. The machine is in an unheated area. If outside temperatures are above 20°C I think it's not necessary to run a full warm-up. But when it's cold I think it's better to warm-up the drive prior routing. You don't think so?

Alex

Re: Spindel Warm-Up Macro

PostPosted: Fri May 05, 2017 9:25 pm
by ger21
You certainly don't need 16 minutes of warm up time. As I said, 1-2 minutes should be fine. But it's your spindle, and your money.

Re: Spindel Warm-Up Macro

PostPosted: Sat May 06, 2017 2:06 am
by Dan911
BigAl wrote:Ok, I've done it.

And YES, it's necessary, because I don't like to damage my 1400 Euro spindle.

I added a button to the screen (ID=20000) and a textfield (ID=20000). With the button I can start or interrupt the warm-up procedure. While the warm-up procedure is running the button for warm-up blinks and show me the remaining seconds of the current stage. Now I can leave my workshop while the spindle is warming up and drink a coffee :-)

The screen looks like this:

WarmUp.png


And the macro looks like this:

Code: Select all
//  Spindle Heat-Up

// stages for warm-up
const int Stages = 4;

double[] Speed = new double[Stages];
int[] Time = new int[Stages];

Speed[0] = 6000;
Time[0] = 300;

Speed[1] = 12000;
Time[1] = 300;

Speed[2] = 18000;
Time[2] = 240;

Speed[3] = 6000;
Time[3] = 60;

// Position for the warm-up procedure
double PosX = 0;
double PosY = 620;
double PosZ = 140;

if (AS3.Getbuttonstate(20000)) // if the warm-up is running already stop it
{
  // switch the state to "off"
  AS3.Switchbutton(false, 20000);
}
else // start heat-up
{
  // machine must be homed
  if(!exec.GetLED(56)||!exec.GetLED(57)||!exec.GetLED(58))
  {
    MessageBox.Show("The machine was not yet homed, home the machine before warm-up!");
    AS3.Setfieldtext("ERROR", 20000);

    // leave the macro
    exec.Stop();
    return;
  }

  // show init info
  AS3.Setfieldtext("INIT", 20000);

  // switch the state to "on"
  AS3.Switchbutton(true, 20000);

  // store the current distance mode
  int DistanceMode = exec.actualmodal;

  // wait until everything is stopped
  while(exec.IsMoving()){}

  // move the Z axis to the warm-up position
  exec.Code("G00 G53 Z"+ PosZ);
  while(exec.IsMoving()){}
  exec.Wait(200);

  // move the X and Y axis to the warm-up position
  exec.Code("G00 G53 X" + PosX +" Y" + PosY);
  while(exec.IsMoving()){}
  exec.Wait(200);

  // restore the original distance mode
  exec.Code("G" + DistanceMode);

  // perform the stages
  int Stage = 0;
  while (Stage < Stages)
  {
    // set the spindle speed
    exec.Code("S" + Speed[Stage]);

    // turn the spindle on
    exec.DospinCW();

    // wait
    int Secs = 0;
    while (Secs < Time[Stage])
    {
      exec.Wait(1000);
      Secs++;
      AS3.Setfieldtext((Time[Stage] - Secs).ToString(), 20000);

      // interrupt the warm-up?
      if (!AS3.Getbuttonstate(20000))
      {
        // stop the spindle
        exec.Stopspin();
        // show interrupt
        AS3.Setfieldtext("", 20000);
        // leave the macro
        exec.Stop();
        return;
      }
    }

    // next Stage
    Stage++;
  }

  // stop the spindle
  exec.Stopspin();

  // switch the state to "off"
  AS3.Switchbutton(false, 20000);
  AS3.Setfieldtext("OK", 20000);
}



My old AXYZ cnc came with a spindle warm up and I followed with a similar setup you did with Mach3 and now UCCNC. I think AXYZ spindle warm up was 10 min, I did mine setup with 8 min.

Dan

Re: Spindel Warm-Up Macro

PostPosted: Fri May 26, 2017 9:53 am
by Battwell
i usually just start my hsd £10k spindle at 8000 rpm and let it run while im finding code etc- about 2 minutes. just long enough to take the chill off the bearings.
i dont think its needed with most of the things we do- as we are all mainly using very small cutters. i have current draw display on my machine- and it rarely goes above 4 amp- where its max is 34 amp to develop its full hp rating ! 7.5kw spindle
to get to its full 9hp you need to be running massive tooling like 5" diameter spindle moulding blocks