Page 1 of 2

Default feedrate at startup

PostPosted: Sat Sep 23, 2017 2:25 am
by Greolt
Feedrate defaults to 6 at startup.

Step Jog is done at the presently set feedrate.

Very often one of the first things I do at startup is position the spindle at the origin of the job. This involves step jog.

For me 6mm/min is frustratingly slow. MDI is the only way to set feedrate to my desired speed.

How do I alter the default feedrate set at startup

I tried adding the following to the constructor macro,

AS3.Setfieldtext("1000",867);
As3.Validatefield(867);

This does succeed in setting the Fset DRO to 1000 but that value is ignored by the step jog. Still jogs at 6mm/min.

Also tried,

exec.Code("F1000");

Re: Default feedrate at startup

PostPosted: Sat Sep 23, 2017 5:56 am
by dezsoe
To set feedrate you first have to wait for UCCNC to get ready and turn off reset. You cannot do this all in the constructor macro. Create a new macro with the following code and set it in Config macroloops as Autorun.

Code: Select all
// ================================================================================================
// Set feedrate on first reset
// ================================================================================================

bool ResetNow = exec.GetLED(ResetLED);

if (FirstRun && !ResetNow)
{
  while (!exec.GetLED(ResetLED))
    Thread.Sleep(10);
  ResetNow = exec.GetLED(ResetLED);
}

FirstRun = false;

if (NeedCheck && !ResetNow)
{
  NeedCheck = false;
  Thread.Sleep(100);
  exec.Code("F1000");
  AS3.Additemtolistbeginning("F1000 is set", 2);
}

// ================================================================================================

#Events

// ================================================================================================

const int ResetLED = 25;

static bool FirstRun = true;
static bool NeedCheck = true;

This will first wait for reset signal to get ready, and then it waits for the first press of reset. On the first press of reset it sets "F1000" as you need.

Re: Default feedrate at startup

PostPosted: Sat Sep 23, 2017 11:28 am
by ger21
Thanks for that. So many things you can do, that most people wouldn't even know where to start.

Re: Default feedrate at startup

PostPosted: Sat Sep 23, 2017 12:01 pm
by Greolt
Thanks dezoe

Wow... this simple tradesman has some reading to do to try and figure what all that means. :D

I must say, is this something UCCNC needs a setting for in Gen Config?

Maybe a default feedrate of 6mm/min won't bother any other users. Just me! :shock:

Re: Default feedrate at startup

PostPosted: Sat Sep 23, 2017 12:29 pm
by ger21
No, it bothers everyone.
This little macroloop would be the equivalent of Mach3's initialization string, which you'd use in Mach3 to get around the 6 unit/min feedrate. :)

Re: Default feedrate at startup

PostPosted: Sat Sep 23, 2017 3:54 pm
by dezsoe
Thanks! It was an after-wake-up-before-coffee job, with some surprise. I thought it'll be 3 minutes to finish. It was. Until program restart. Normally the code would contain only the check for NeedCheck and the reset LED. But if you shrink the code to that, it will not work on startup. I'll show it to Balázs, because it's not normal, that macroloop starts before the M99998 constructor is finished, and when it first starts, reset is in an unknown state. (Exactly, it is not unknown: reset is on inside the system, but it's LED isn't on yet, so the condition is true to go, but internal logic tells that reset is on. The result is a nice reset warning on startup, and the NeedCheck is fired, so it will not run on later reset click.) So, it was not 3 minutes, it was about an hour. :)

BTW: I also "left" it turned on with F100 when I finished. :)

Re: Default feedrate at startup

PostPosted: Sat Sep 23, 2017 5:46 pm
by cncdrive
The startup sequence is an interesting question and basicly there is no 100% satisfactory solution for all cases, because there is the startup macro, there are macro loops, there are plugins and each of them may use and may depend on the others and so with every possible startup sequences there will be a possibly an issue.

Re: Default feedrate at startup

PostPosted: Sat Sep 23, 2017 6:10 pm
by dezsoe
Yes, I know it's not easy. Anyway, I found the solution, so first I wait for the reset LED to turn on.

Re: Default feedrate at startup

PostPosted: Sat Sep 23, 2017 11:38 pm
by Greolt
ger21 wrote:No, it bothers everyone.
This little macroloop would be the equivalent of Mach3's initialization string, which you'd use in Mach3 to get around the 6 unit/min feedrate. :)


I have had F1000 in the Mach3 initialisation string for so long that I had forgotten Mach3 defaulted to F6 at startup.

If in fact it does bother a lot of users, then maybe this should be settable at program level, rather than users needing to use a clever macroloop like what dezsoe has kindly written

I would hazard a guess that most UCCNC users are not experienced programmers like dezsoe.

Re: Default feedrate at startup

PostPosted: Wed Jan 31, 2018 4:43 pm
by Sword
+1 on the ability to have a config setting for a start up feedrate. While the above macro works, it only works if you don't do anything else first. For example, if you just want to load a file for preview and do so without first hitting Reset, the macro doesn't set the chosen feedrate when you finally do hit Reset (it does give the message that it was set though).