Machsupport Forum

Mach Discussion => Mach4 General Discussion => Topic started by: Wallerawang on May 20, 2016, 03:04:37 AM

Title: Spindle Feedback Ratio
Post by: Wallerawang on May 20, 2016, 03:04:37 AM
Hello Guys

I have Mach4 - latest version - going through an Ethernet Smooth Stepper with their latest plug in, driving my spindle through a PWM signal.
The motor behaves wonderfully and seems to be very accurate to the commanded speed.
I have an index input signal from a slotted optical switch which I also believe works well.

My trouble is wildly varying spindle speed read out on my screen. When I look at the machine diagnostics page I see the Spindle Feedback Ratio changing constantly - it is set to 1 in the config settings and I just want it to stay at 1.
Is there any way it can be locked at 1?

Thanks
Steve
Title: Re: Spindle Feedback Ratio
Post by: Chaoticone on May 20, 2016, 08:47:00 AM
Yup....... that will be updated soon but you can edit your screens PLC script now to fix it if you want to.
Code: [Select]

--Change this ***********************
-------------------------------------------------------
--  Set Feedback Ratio DRO
-------------------------------------------------------
--local spindlerpm = scr.GetProperty('droSpindleRPM', 'Value');   
--local truerpm = scr.GetProperty('droTrueRPM', 'Value');   
--local feedbackratio = (truerpm / spindlerpm);   
--scr.SetProperty('droFeedbackRatio', 'Value', tostring(feedbackratio));

--To this ********************************
-------------------------------------------------------
--  Set Feedback Ratio DRO
-------------------------------------------------------
local range, rc = mc.mcSpindleGetCurrentRange(inst)
local fbratio, rc = mc.mcSpindleGetFeedbackRatio(inst, range)
scr.SetProperty('droFeedbackRatio', 'Value', tostring(fbratio))

Title: Re: Spindle Feedback Ratio
Post by: Wallerawang on May 20, 2016, 09:59:07 AM
Thanks Mate :)
Title: Re: Spindle Feedback Ratio
Post by: Chaoticone on May 20, 2016, 11:48:25 AM
No problem, hope it gets you sorted.