Page 1 of 1

Changing Spindle Encoder PPR "on the fly"

PostPosted: Sat Nov 03, 2018 4:23 pm
by MattTheNoob
There are lots of topics that get close this question, but I couldn't find any that hit it exactly.
I want to set up for rigid tapping.
I have a 2-speed pulley drive to my spindle. I want to put the encoder on the motor, and pick up an index pulse from the spindle. My question is if there is a way to access the "spindle" ppr setting through a macro or other automatic means so when I select my pulley in the UCCNC software it will automatically load the new PPR value.

(Unrelated to my question, but background on me and the machine, since this is my first post. I've been CNC'ing for about 10 years since I picked up a mid-80's Bostomatic 3+2 with punch tape reader and did a complete controls retrofit to Mach.

Up until recently I have had a completely functional CNC machine... which just wouldn't do. :D In addition to the main 10k rpm spindle, the machine is fitted with a 40k rpm IBAG requiring 833hz to run. This meant I'd need a new VFD for the high speed spindle.

One thing lead to another and I've decided to gut the electrical panel, fix all of the daisy-chained neutral wires, overstuffed wireways insanely large relays, and other general messiness. (yeah, I have issues.) So now I'm moving to UCCNC with a UC300, adding a plc to get rid of all of the hard-wired relay logic (yeah, I know I could do everything through the UC300)... and also (just to get back to my question) must have rigid tapping capability.)

Re: Changing Spindle Encoder PPR "on the fly"

PostPosted: Sun Nov 04, 2018 9:32 am
by dezsoe
Yes and no. You can change any setting by a macro, but never do it while cycle is running. (I can't remember when was it fixed, but in older versions you could "press" Apply/Save while running and it made a total chaos. :)) So, you can set PPR value with

Code: Select all
AS3.Setfield(newppr, 864); // set new value
AS3.Validatefield(864); // Validate
exec.Callbutton(168); // Apply settings

but never run this code while cycle is running. Field 2013 gives you the selected pulley number. You may check this value for changes in a macroloop to change the PPR, but you also have to check for LED 54 (Cyclestart) before changing PPR.

Re: Changing Spindle Encoder PPR "on the fly"

PostPosted: Sun Nov 04, 2018 1:09 pm
by MattTheNoob
Fantastic! Yeah, I guess "on the fly" wasn't really the right phrase.
Thanks for the guidance. This simplifies the path I need to take.

Re: Changing Spindle Encoder PPR "on the fly"

PostPosted: Mon Nov 05, 2018 1:03 am
by MattTheNoob
Well that would be convenient. Thanks for the help!