Hello Guest it is May 15, 2021, 07:08:03 PM

Author Topic: Mach 4 Mill CSS  (Read 542 times)

0 Members and 1 Guest are viewing this topic.

Mach 4 Mill CSS
« on: April 30, 2019, 10:31:22 AM »
Does Mach 4 Mill support constant surface speed? If so how do you set it up?

I am running my mill as a lathe for small diameter work using work offsets for tool positions. This works great but it would be nice if I could use CSS and feed per rev like a normal lathe.

Offline Chaoticone

  • *
  •  5,626 5,626
  • Precision Chaos
    • View Profile
Re: Mach 4 Mill CSS
« Reply #1 on: April 30, 2019, 10:55:19 AM »
In lathe it is handled in the default screens PLC script. I'm not sure but you may be able to adapt it to work for your purpose in doing some mill turning. The API says its for lathe but it may well work for mill too. Take note that it uses the X axis current position to determine diameter. Depending on how your doing things that may not work for you. But you could adapt it. Just pointing it out. It uses some screen elements so you would need to....

1) Save your screen as something new and unique.
2) Modify the new screen making sure it has all the elements needed (and named correctly).
3) Test

Here is the code that does the magic in lathe............

Code: [Select]
--  Calculate CSS
local NativeUnits, rc = mc.mcCntlGetUnitsDefault(inst)
local units, rc = mc.mcCntlGetUnitsCurrent(inst)
local xDia = mc.mcAxisGetPos(inst, 0)
local dia, rc = mc.mcCntlGetDiaMode(inst)

if (dia == 0) then
 xDia = (xDia * 2)

if (NativeUnits == 200) and (units == 210) then
 xDia = (xDia * 25.4)
elseif (NativeUnits == 210) and (units == 200) then
 xDia = (xDia / 25.4)

if (units == 200) then --Gcode is in inch mode (G20)
    mc.mcSpindleCalcCSSToRPM(inst, xDia, true)
elseif (units == 210) then --Gcode is in mm mode (G21)
    mc.mcSpindleCalcCSSToRPM(inst, xDia, false)

local FeedRate, SpinRPM, CurrentCSS
FeedRate = scr.GetProperty ("droFeedRate", "Value")
FeedRate = tonumber(FeedRate)
SpinRPM = scr.GetProperty("droSpinRPM", "Value")
SpinRPM = tonumber(SpinRPM)
CurrentCSS = (FeedRate / SpinRPM)
if CurrentCSS ~= LastCSS then --We need to update our user DRO
    LastCSS = CurrentCSS --So we only update DRO when needed. Stops blinking DRO
    if (FeedRate > 0) and (SpinRPM > 0) then
        scr.SetProperty("droConstantSurfaceSpeed", "Value", tostring(CurrentCSS))
        scr.SetProperty("droConstantSurfaceSpeed", "Value", "0.0000")
« Last Edit: April 30, 2019, 10:58:29 AM by Chaoticone »
;D If you could see the things I have in my head, you would be laughing too. ;D

My guard dog is not what you need to worry about!
Re: Mach 4 Mill CSS
« Reply #2 on: April 30, 2019, 11:21:28 AM »
Awesome! Thank you. I am using the X axis same as the lathe (just in radius mode). I will play around with this.

Offline Graham Waterworth

  • *
  •  2,322 2,322
  • Yorkshire Dales, England
    • View Profile
Re: Mach 4 Mill CSS
« Reply #3 on: May 01, 2019, 06:03:00 AM »
It sure can be done, here is a video :- https://www.youtube.com/watch?v=i02DmXtH3XM
Without engineers the world stops
Re: Mach 4 Mill CSS
« Reply #4 on: July 06, 2019, 01:29:55 AM »
Excellent site. Plenty of helpful information here. I am sending it to some buddies ans additionally sharing in delicious.