Hello Guest it is March 28, 2024, 08:59:46 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 - jorgenbli

Pages: 1 2 3 »
1
Mach4 General Discussion / Re: Mach4 and Autoleveller issues ( CSMIO IP-M)
« on: September 14, 2022, 01:34:26 PM »
I'm using CSMIO/IP-A controller and I got the same trouble with "data mismatch" warning when implementing Autoleveller with Mach 4 using your M40 and M41 scripts. So maybe it is a CS-LABS related issue?

I added delays in the probing script to figure out what caused this and in the end I found the reason this mismatch is happening is because every time I run the probing command G31.1 it will write the coordinates from the previous probing cycle, so the last probing point was never recorded. My workaround is to probe twice at the last probing point. That way I get the last probing point into the file.
This also means that the first data point that is being recorded is data from the probe cycle happening prior to M40. Because it has approximately the same values as the second point, one of these are deleted as they are considered duplicates.

I tried to figure out how the registers actually is updated after M40 is activated to see if I could figure out a better way to solve it, but I wasn't able to understand how the registers actually are being updated. Do you see a better way to solve this?

2
I'm having a wired 3D-touch probe in my linear ATC system. The plug for the wire is automatically connected as the spindle picks the tool holder for the probe. The same plug also keeps the probe from rotating (no encoder or brake on the spindle).

However, if the spindle is started while the probe is in there, the wire will get ripped off and the probe will get damaged. Any best practice for preventing Mach4 to start the spindle as long as a specific tool number is in the spindle?

3
Is there a way to avoid that mach4 forgets the current spindle speed setting after stopping a program. Sometimes I need to stop a program somewhere into it, and when I then start up the program again (from where I stopped it), the spindle will start at its default lowest speed.  In order to fix this, I need to issue an S command on the MDI every time before starting within a program. This annoys me, as I see no reason why the spindle speed is reset at stop.

4
Awesome. Thank you!

5
I'was able to add scripts to stop, reset and feed hold buttons. However, I couldn't find a way to add to the disable buttton and the e-stop routine. Any suggestions?

6
Tried another version, and tried without the controller. So it looks like it's not supported in the screen set (wx4). I am able to add the g-code in a script for each button, or in the function in the screen load script using, for example, mc.mcCntlMdiExecute(inst, "M9"). However, I find it very strange that such a thing isn't included by default. Especially for the M62 M63 scripts that are designed to control lasers. If you hit the e-stop, feed hold, cycle stop, reset or disable button the laser should switch off without every user having to figure out a way to implement it in the screen.

7
I'd like to use mach4 to control a laser, using M62/M63 However, if I have to stop the program by the stop button, or even by the emergency stop button, the output does not stop. Is this a bug in mach4 (build 3804)?
I thought I could rather use M8/M9 to control the output, however, I get the same problem here also. The output stays open even if I hit the emergency stop button. Controller is a CSMIO IP-M.

8
General Mach Discussion / Re: Configuring a light curtain for a CNC router
« on: November 30, 2018, 04:10:46 PM »
Thanks MadDog,
The machine is for my company and will be operated by others than me. The main goal is to avoid anyone getting hurt by it. At the same time, it should be possible to operate it to set work zero etc easily while being inside the curtains. I know on CNC mills it is usually possible to jog the machine with the main door open, and even run the spindle at low rpm.

9
General Mach Discussion / Re: Configuring a light curtain for a CNC router
« on: November 29, 2018, 10:19:13 PM »
I'm currently working on this setup and this is what I want to happen when the curtain is triggered:
- Stop a running program
- Spindle start not allowed
- Limit max allowable speeds
- Disable JOG, CYCLE START and SPINDLE START buttons
The intention is that after the light curtain has been triggered it can only be moved by the MPG handwheel, and it will be necessary to "reset" the curtain from a button within mach4 to allow the machine to work normally again.

However, are any of you aware of a way that I can the disable the spindle and limit the feed rates? Are there any pound variables or other ways to set these? And are there any way to disable the buttons in mach4?
Thanks for any input.

10
Mach4 General Discussion / Improve M6 macro for linear ATC
« on: July 18, 2018, 06:16:25 PM »
I am setting up a machine with a linear ATC. The script is based on the example in the Lua scripting guide in the documentation folder of Mach4. The script is working somehow, but there is an issue if you hit the Stop button during a tool change as this causes Mach4 to believe the tool change is finished even though it might haven't done anything yet.

Is there a way to make sure the macro is terminated if the Stop button is hit while the tool change is ongoing?
The only way I could think of solving this is to compare the requested tool change position with the actual machine position before and after the tool is but back or released - and if it doesn't reach that position I could return from the script. But if there is an easier way to see if the Stop button was hit that would be better.

Code: [Select]
package.path = wx.wxGetCwd() .. "\\Profiles\\Mach4Mill\\Modules\\?.lua;"
if(package.loaded.ToolChangePositions == nil) then
tcp = require "ToolChangePositions"
end


function m6()

local inst = mc.mcGetInstance()
local SelectedTool = mc.mcToolGetSelected(inst)
local CurrentTool = mc.mcToolGetCurrent(inst)

--  local xstart = mc.mcAxisGetMachinePos(inst,0)
--  local ystart = mc.mcAxisGetMachinePos(inst,1)


local en_axis = 0
    repeat
        local Is_Enabled = mc.mcAxisIsEnabled(inst, en_axis)
            if Is_Enabled == 1 then
                local is_Homed = mc.mcAxisIsHomed(inst, en_axis)
                if is_Homed ~= 1 then
                mc.mcCntlEnable(inst, 0)
                wx.wxMessageBox("RESET: Machine was not referenced")
                return
                end
            end
        en_axis = en_axis + 1
    until( en_axis == 6 )

if SelectedTool == CurrentTool then
mc.mcCntlSetLastError(inst, "No need for tool change!")
do return end
end
 
 
    ------ Get current state ------     
local CurFeed = mc.mcCntlGetPoundVar(inst, 2134)   
local CurFeedMode = mc.mcCntlGetPoundVar(inst, 4001)   
local CurAbsMode = mc.mcCntlGetPoundVar(inst, 4003)





     ------ Get position data for current tool ------
ToolData = tcp.GetToolData(CurrentTool)

if (ToolData ~= nil) then     
Num1 = ToolData.Tool_Number   
XPos1 = ToolData.X_Position     
YPos1 = ToolData.Y_Position     
ZPos1 = ToolData.Z_Position 
else     
mc.mcCntlEStop(inst)
mc.mcCntlSetLastError(inst, "ERROR: No place for this tool. Tool number out of range!")
do return end
end



 ------ Get position data for next tool ------
ToolData = tcp.GetToolData(SelectedTool)

if (ToolData ~= nil) then     
Num2 = ToolData.Tool_Number     
XPos2 = ToolData.X_Position     
YPos2 = ToolData.Y_Position     
ZPos2 = ToolData.Z_Position
else     
mc.mcCntlEStop(inst)
mc.mcCntlSetLastError(inst, "ERROR: Requested tool number out of range!")
do return end
end


------ Move to current tool change position ------     
local GCode = ""     
GCode = GCode .. "G00 G90 G53 Z0.0\n"     
GCode = GCode .. string.format("G00 G90 G53 X%.4f Y%.4f\n", XPos1, YPos1-100)     
GCode = GCode .. string.format("G00 G90 G53 Z%.4f\n", ZPos1)     
GCode = GCode .. string.format("G01 G90 G53 Y%.4f F100\n", YPos1)
mc.mcCntlGcodeExecuteWait(inst, GCode)         

wx.wxMessageBox("Machine will now open drawbar")

------ Release drawbar ------     
local DrawBarOut = mc.OSIG_OUTPUT10     
local hsig = mc.mcSignalGetHandle(inst, DrawBarOut)     
mc.mcSignalSetState(hsig, 1)



------ Move to current tool change position ------     
local GCode = ""     
GCode = GCode .. string.format("G00 G90 G53 Z%.4f\n", ZPos1+20)
GCode = GCode .. string.format("G00 G90 G53 X%.4f Y%.4f\n", XPos2, YPos2)     
GCode = GCode .. string.format("G00 G90 G53 Z%.4f F100\n", ZPos2)     
mc.mcCntlGcodeExecuteWait(inst, GCode) 



------ Clamp drawbar ------     
mc.mcSignalSetState(hsig, 0)


------ Retract from tool holder ------     
local GCode = ""   
GCode = GCode .. string.format("G00 G90 G53 X%.4f Y%.4f\n", XPos2, YPos2-100)   
GCode = GCode .. "G00 G90 G53 Z0.0\n"   
mc.mcCntlGcodeExecuteWait(inst, GCode)


------ Reset state ------     
mc.mcCntlSetPoundVar(inst, 2134, CurFeed)     
mc.mcCntlSetPoundVar(inst, 4001, CurFeedMode)     
mc.mcCntlSetPoundVar(inst, 4003, CurAbsMode)

    -- mc.mcCntlGcodeExecuteWait(inst, "G90 G53 G0 X"..xstart.." Y"..ystart)  --back to initial position
   
mc.mcToolSetCurrent(inst, SelectedTool)             -- change to new tool
    mc.mcCntlSetPoundVar(inst, 2032, SelectedTool) -- set height offset number
    mc.mcCntlGcodeExecuteWait(inst, "G43 H"..SelectedTool)
   

mc.mcCntlSetLastError(inst, string.format("Tool change finished - Tool: %.0f", SelectedTool))


end



if (mc.mcInEditor() == 1) then
 m6()
end


Pages: 1 2 3 »