Hello Guest it is April 26, 2024, 09:55:36 AM

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Gerral

Pages: 1 2 »
1
Mach4 General Discussion / Re: Not saving input config change
« on: October 03, 2022, 08:21:57 AM »
It's an ESS controller, I'll check that... Thanks!

2
Mach4 General Discussion / Not saving input config change
« on: September 30, 2022, 10:48:54 AM »
I've changed the probe we're using.  The former probe was normally closed, whereas this one is normally open.
In the Mach Configuration when I change the Input Signal to "Active Low", click apply and then OK the change is not implemented or changed.

Is there a setting somewhere that prevents configuration changes?  This is just a generic install of Mach 4 to a custom-made machine.

Thanks for your help!

3
That's great, I didn't realize the Diameters were a #var too! 
Thank you!

4
I can't show an actual photo, due to company confidentiality policy, but I'm attaching a drawing that might clear it up some.

Thank you regarding avoiding G41/G42.  That was what I was thinking.  I can write GCode that could increment a # variable or a lua dialogbox that allow the user to input new values.  A this is a single use machine it shouldn't be a problem.

5
I didn't write the code, the person who made the custom CNC machine did, and I have no information available of how he did it.

I'm helping the guys in the shop, I know the basics of GCode as I'm a programmer and most of it makes sense to me but there are obvious nuances that escape me since I don't actually do this sort of work.

Yes D3 works but D1 and D2 doesn't

Explanation of what this does:
I'm not sure the best way to describe this, but this is a wood musical drum shell and it turns on the A axis.  Z is moving the cutting bit forward and back.  Y is the axis across the  up and down side of the drum where as X is the horizontal and generally stays at 0.0 as that keeps it centered on the turning A axis.
In this code there are 3 groves being cut.  It cuts the center one first.  When he's hitting Y0.016 that's the center grove then it's followed by two more groves on either side of the center one.

When they're cutting the groves into the shell with this, they change the diameter of the tools in 1,2, and 3 to slowly widen the grooves until it fits the wood inlay strip they're putting in.

Thanks for your input... it's been very helpful.

6
I'm embarrassed to admit that I'm not sure what you're referring to.

7
I'm changing it depending on how much wider I need to go, I use the same value in all three.  I go up 0.02 inches at a time till I have it dialed in for the inlay.

8
Mach4 General Discussion / Cutter Compensation not reading tool diameter
« on: October 20, 2020, 10:17:57 AM »
I have the following G-Code that I want to run repeatedly to cut out inlay groves for wood drums.  I want to change the tool diameter with G41 & G42 to slowly widen the grove to fit the inlays.  Inlays aren't necessarily consistent in width.

The code work, except it doesn't seem to be picking up the diameter for tool 1 and 2 (D1 & D2), but it works perfectly on tool 3 (D3).

I'm not seeing anything wrong with the code and am wondering if there's a setting in Mach4 that not set right for this to work on D1 & D2.

Thank you in advance for your help.


g0 g49 g40 g17 g80 g50 g90

g04 p2.
g53 g00 z0

M03
M08


G54 x0 y0.01 a0
z1.
g01 z-.25 f10.
G42 D2
y-.016 f10.
g90
g40
a720. f2000.
g90x0y0
G41 D2
y.016 f10.
g90
g40
a0. f2000.

z1.
G54 x0 y.295 a0
z1.

g01 z-.25f10.
G41 D1

x0 y.279
g90
G40
a720. f2000.

g90x0y0.295
G42 D1

x0 y.311 f10.
g90
G40
a0. f2000.

z1.
G54 x0 y-.295 a0
z1.

g01 z-.25 f10.
G41 D3

x0 y-.311
g90
g40
a720. f2000.
g90x0y-.295
G42 D3

x0 y-.279 f10.
g90
g40
a0. f2000.

g00 z1.
g53 z0.

M09
M05

g53 x1. y-8.

m30


9
Making sure all the dialogs were destroyed did the trick!

I earlier had that whole script in a function assuming when the function went away the garbage collection would remove those arrays.

Great catch guys!!!! Thanks!

10
Mach4 General Discussion / Lua script that causes Mach4 not to terminate
« on: October 26, 2015, 07:16:04 PM »
I've a script with some dialog boxes that show up to remind the operator when certain maintenance should be performed.  I used to have this in the startup, but I've relegated it to a button.  For whatever reason when this is run Mach4 will NOT terminate properly when closed, you have to use the task manager.  I upgraded to the newest Mach4 today 10/26/15 with hopes it would correct the issue but it doesn't.

Are there any script monkeys out there that might spot what I'm doing wrong here, I've gone through it and tried different permutations of this code.  It's really quite simple, it's reading values from the profile that are written by other jobs that have run and prompting the operator to take care of whatever needs taken care of.

Thanks!

Again.. this currently run within a button:

    local MyInstance = mc.mcGetInstance()
    local DailyMaintenance={}
    DailyMaintenance = wx.wxDialog (wx.NULL, wx.wxID_ANY, "DailyMaintenance", wx.wxDefaultPosition, wx.wxDefaultSize, wx.wxCAPTION )
    DailyMaintenance:SetSizeHints( wx.wxDefaultSize, wx.wxDefaultSize )

    local bSizer2 = wx.wxBoxSizer( wx.wxVERTICAL )

    bSizer2:SetMinSize( wx.wxSize( 500,-1 ) )
    CheckHoses = wx.wxCheckBox( DailyMaintenance, wx.wxID_ANY, "Check Hoses, fittings and valves for wear or damage.", wx.wxPoint( -1,-1 ), wx.wxDefaultSize, 0 )
    bSizer2:Add( CheckHoses, 0, wx.wxALL, 5 )

    CheckwaterTrap = wx.wxCheckBox( DailyMaintenance, wx.wxID_ANY, "Ensure water trap is clear, and drain if necessary.", wx.wxDefaultPosition, wx.wxDefaultSize, 0 )
    bSizer2:Add( CheckwaterTrap, 0, wx.wxALL, 5 )

    Checkdebris = wx.wxCheckBox( DailyMaintenance, wx.wxID_ANY, "Wipe any excessive debris from ballscrews and guideways", wx.wxDefaultPosition, wx.wxDefaultSize, 0 )
    bSizer2:Add( Checkdebris, 0, wx.wxALL, 5 )

    local m_sdbSizer2 = wx.wxStdDialogButtonSizer()
    local m_sdbSizer2OK = wx.wxButton( DailyMaintenance, wx.wxID_OK, "" )
    m_sdbSizer2:AddButton( m_sdbSizer2OK )
    local m_sdbSizer2Cancel = wx.wxButton( DailyMaintenance, wx.wxID_CANCEL, "" )
    m_sdbSizer2:AddButton( m_sdbSizer2Cancel )
    m_sdbSizer2:Realize();

    bSizer2:Add( m_sdbSizer2, 1, wx.wxEXPAND, 5 )


    DailyMaintenance:SetSizer( bSizer2 )
    DailyMaintenance:Layout()
    bSizer2:Fit( DailyMaintenance )

    DailyMaintenance:Centre( wx.wxBOTH )

    -- Connect Events

    m_sdbSizer2Cancel:Connect( wx.wxEVT_COMMAND_BUTTON_CLICKED, function(event)
    DailyMaintenance:Destroy()
    end )

    m_sdbSizer2OK:Connect( wx.wxEVT_COMMAND_BUTTON_CLICKED, function(event)
    local a= CheckwaterTrap:GetValue()
    local b = CheckHoses:GetValue()
    local c = Checkdebris:GetValue()
    if ( a and b and c ) == true then                 
      mc.mcProfileWriteString(MyInstance , "DrumMaker", "DailyMaint", tostring(os.time()))
      DailyMaintenance:Destroy()
    else
      wx.wxMessageBox("You must mark all tasks as being completed to proceed")
    end
    end )


    -- create WeeklyMaintance
   local WeeklyMaintance={}
    WeeklyMaintance = wx.wxDialog (wx.NULL, wx.wxID_ANY, "Weekly Maintance", wx.wxDefaultPosition, wx.wxSize( 500,110 ), wx.wxCAPTION )
    WeeklyMaintance:SetSizeHints( wx.wxDefaultSize, wx.wxDefaultSize )

    local bSizer4 = wx.wxBoxSizer( wx.wxVERTICAL )

    bSizer4:SetMinSize( wx.wxSize( 500,-1 ) )
   local CheckWeeklyGrease = wx.wxCheckBox( WeeklyMaintance, wx.wxID_ANY, "Apply single shot of grease to each guideway grease fitting", wx.wxDefaultPosition, wx.wxDefaultSize, 0 )
    bSizer4:Add( CheckWeeklyGrease, 0, wx.wxALL, 5 )

    local CheckWeeklyGreaseBall = wx.wxCheckBox( WeeklyMaintance, wx.wxID_ANY, "Apply single shot of grease to each ball nut", wx.wxDefaultPosition, wx.wxDefaultSize, 0 )
    bSizer4:Add( CheckWeeklyGreaseBall, 0, wx.wxALL, 5 )

    local m_sdbSizer3 = wx.wxStdDialogButtonSizer()
    local m_sdbSizer3OK = wx.wxButton( WeeklyMaintance, wx.wxID_OK, "" )
    m_sdbSizer3:AddButton( m_sdbSizer3OK )
    local m_sdbSizer3Cancel = wx.wxButton( WeeklyMaintance, wx.wxID_CANCEL, "" )
    m_sdbSizer3:AddButton( m_sdbSizer3Cancel )
    m_sdbSizer3:Realize();

    bSizer4:Add( m_sdbSizer3, 1, wx.wxEXPAND, 5 )


    WeeklyMaintance:SetSizer( bSizer4 )
    WeeklyMaintance:Layout()

    WeeklyMaintance:Centre( wx.wxBOTH )

    -- Connect Events

    m_sdbSizer3Cancel:Connect( wx.wxEVT_COMMAND_BUTTON_CLICKED, function(event)
    WeeklyMaintance:Destroy()
    end )

    m_sdbSizer3OK:Connect( wx.wxEVT_COMMAND_BUTTON_CLICKED, function(event)
    local a= CheckWeeklyGrease:GetValue()
    local b = CheckWeeklyGreaseBall:GetValue()
    if ( a and b ) == true then     
      mc.mcProfileWriteString(MyInstance , "DrumMaker", "WeeklyMaint", tostring(os.time())) 
      WeeklyMaintance:Destroy()
    else
      wx.wxMessageBox("You must mark all tasks as being completed to proceed")
    end
    end )

    -- create MonthlyMaintenance
   local MonthlyMaintenance={}
    MonthlyMaintenance = wx.wxDialog (wx.NULL, wx.wxID_ANY, "Monthly Maintenance", wx.wxDefaultPosition, wx.wxSize( 500,-1 ), wx.wxCAPTION )
    MonthlyMaintenance:SetSizeHints( wx.wxDefaultSize, wx.wxDefaultSize )

    local bSizer3 = wx.wxBoxSizer( wx.wxVERTICAL )

    bSizer3:SetMinSize( wx.wxSize( 500,-1 ) )
    local CheckInspect = wx.wxCheckBox( MonthlyMaintenance, wx.wxID_ANY, "Closely inspect guideways and rails for excessive buildup of grease and debris", wx.wxDefaultPosition, wx.wxDefaultSize, 0 )
    bSizer3:Add( CheckInspect, 0, wx.wxALL, 5 )

    local m_sdbSizer3 = wx.wxStdDialogButtonSizer()
    local m_sdbSizer3OK = wx.wxButton( MonthlyMaintenance, wx.wxID_OK, "" )
    m_sdbSizer3:AddButton( m_sdbSizer3OK )
    local m_sdbSizer3Cancel = wx.wxButton( MonthlyMaintenance, wx.wxID_CANCEL, "" )
    m_sdbSizer3:AddButton( m_sdbSizer3Cancel )
    m_sdbSizer3:Realize();

    bSizer3:Add( m_sdbSizer3, 1, wx.wxEXPAND, 5 )


    MonthlyMaintenance:SetSizer( bSizer3 )
    MonthlyMaintenance:Layout()

    MonthlyMaintenance:Centre( wx.wxBOTH )

    -- Connect Events

    m_sdbSizer3Cancel:Connect( wx.wxEVT_COMMAND_BUTTON_CLICKED, function(event)
    MonthlyMaintenance:Destroy()
    end )

    m_sdbSizer3OK:Connect( wx.wxEVT_COMMAND_BUTTON_CLICKED, function(event)
    local a= CheckInspect:GetValue()
    if (a) then     
      mc.mcProfileWriteString(MyInstance , "DrumMaker", "MonthlyMaint", tostring(os.time())) 
      MonthlyMaintenance:Destroy()
    else
      wx.wxMessageBox("You must mark all tasks as being completed to proceed")
    end
    end )


   

    -- create StartUpVerify
   local StartUpVerify={}
    StartUpVerify = wx.wxDialog (wx.NULL, wx.wxID_ANY, "Starting up CNC machine", wx.wxDefaultPosition, wx.wxDefaultSize, wx.wxCAPTION + wx.wxSTAY_ON_TOP )
    StartUpVerify:SetSizeHints( wx.wxDefaultSize, wx.wxDefaultSize )

    local bSizer8 = wx.wxBoxSizer( wx.wxVERTICAL )

    local gSizer2 = wx.wxGridSizer( 1, 2, 0, 0 )

    local m_staticText13 = wx.wxStaticText( StartUpVerify, wx.wxID_ANY, "What tool number is presently in the spindle?", wx.wxDefaultPosition, wx.wxDefaultSize, 0 )
    m_staticText13:Wrap( -1 )
    gSizer2:Add( m_staticText13, 0, wx.wxALL, 5 )

    local MyToolNumber = wx.wxTextCtrl( StartUpVerify, wx.wxID_ANY, "", wx.wxDefaultPosition, wx.wxDefaultSize, 0 )
    gSizer2:Add( MyToolNumber, 0, wx.wxALL, 5 )


    bSizer8:Add( gSizer2, 1, wx.wxEXPAND, 5 )

    local StartupOK = wx.wxStdDialogButtonSizer()
    local StartupOKOK = wx.wxButton( StartUpVerify, wx.wxID_OK, "" )
    StartupOK:AddButton( StartupOKOK )
    StartupOK:Realize();

    bSizer8:Add( StartupOK, 1, wx.wxEXPAND, 5 )


    StartUpVerify:SetSizer( bSizer8 )
    StartUpVerify:Layout()
    bSizer8:Fit( StartUpVerify )

    StartUpVerify:Centre( wx.wxBOTH )

    -- Connect Events

    StartupOKOK:Connect( wx.wxEVT_COMMAND_BUTTON_CLICKED, function(event)
    local CurrentTool = mc.mcToolGetCurrent(MyInstance)
   local EnteredTool = tonumber(MyToolNumber:GetValue())   
    if CurrentTool == EnteredTool then
      StartUpVerify:Destroy()
   else
      wx.wxMessageBox("This is not the expected tool!\n\nThe system is expecting tool "..tostring(CurrentTool).."!\nMake sure tool number "..tostring(CurrentTool).." is in the spindle before enabling!","ERROR")
      StartUpVerify:Destroy()
   end
    end )
   
  local MyInstance = mc.mcGetInstance()

  local CurrentTime=os.time()
  local FirstUsed = tonumber((mc.mcProfileGetString(MyInstance,"DrumMaker","FirstUsed","0")))

  local LastUsed = tonumber((mc.mcProfileGetString(MyInstance,"DrumMaker","LastUsed","0")))
  local DrumCount = tonumber((mc.mcProfileGetString(MyInstance,"DrumMaker","DrumCount","0")))
  local TimeUsed = tonumber((mc.mcProfileGetString(MyInstance,"DrumMaker","TimeUsed","0")))
  local DailyMaint = tonumber((mc.mcProfileGetString(MyInstance,"DrumMaker","DailyMaint","0")))
  local WeeklyMaint = tonumber((mc.mcProfileGetString(MyInstance,"DrumMaker","WeeklyMaint","0")))
  local MonthlyMaint = tonumber((mc.mcProfileGetString(MyInstance,"DrumMaker","MonthlyMaint","0")))
  local LastUsedDate=os.date("*t",LastUsed)
  local TodayDate = os.date("*t")

  local RunDayCheck = not (os.date("%x",TodayDay)== os.date("%x",DailyMaint))
  local RunWeeklyCheck = ((TimeUsed - WeeklyMaint) > 144000 )
  local RunMonthlyCheck = ((CurrentTime - MonthlyMaint) > 3456000)
  local RunIdleCheck = ((CurrentTime - LastUsed) > 3456000)
     mc.mcProfileWriteString(MyInstance , "DrumMaker", "RunWarmUp", "N")   
  mc.mcProfileWriteString(MyInstance , "DrumMaker", "RunBreakIn", "N")   
  if RunDayCheck then
    DailyMaintenance:ShowModal()
  end
  if RunWeeklyCheck then
    WeeklyMaintance:ShowModal()
    mc.mcProfileWriteString(MyInstance , "DrumMaker", "WeeklyMaint", tostring(TimeUsed))   
  end
  if RunMonthlyCheck then
    MonthlyMaintenance:ShowModal()
  end
  StartUpVerify:ShowModal()
   



Pages: 1 2 »