Hello Guest it is April 27, 2024, 02:39:46 PM

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 - dws

Pages: « 1 2 3
21
Mach4 General Discussion / Re: Digitizing
« on: August 08, 2019, 12:44:53 PM »
This may work for you. Place the m402.mcs macro to the Macros directory of the profile that you are using. On your ShuttlePro, add the Gcode: m402 , and assign a button to that Gcode.

Every time you press that button, the XY coordinates will be added to the Points.txt file located in the GcodeFiles folder.

I am not sure what formatting your CAD program requires. For example, I believe that Fusion360 requires a .csv file with Z coordinates. You can edit the m402 macro change the extension from .txt to .csv, along with any other formatting changes that you require.

22
Mach4 General Discussion / Re: Digitizing in Mach 4
« on: August 07, 2019, 11:12:16 PM »
I used a slightly different approach to digitizing an item using "mc.mcCntlProbeFileOpen". This code works for me. I am new to scripting; and, am suprised about how little code this requires. However, it will grow if a user interface is added to obtain parameters. I have just been editing the parameters within the script. I may add a user interface if I were to use this more frequently.

Code: [Select]
ProbeSurface = coroutine.create(function()
 
  inst=mc.mcGetInstance()
  local GridX = 0.1  -- Spacing of X probing
  local GridY = 0.1  -- Spacing of Y probing
  local ProbeX = 0   -- X Work Coordinates of Probe Start
  local ProbeY = 0   -- Y Work Coordinates of Probe Start
  local ProbeZ = mc.mcAxisGetPos(inst,mc.Z_AXIS) -- work coordinate starting location 
  local ProbeXmax = 2 -- Width of Part
  local ProbeYmax = 0.2 -- Height of Part
  local ProbeZdist = .5   -- Distance to probe Z axis 
  local ProbeRate = 5.0 -- Inches per Minute
  local JogRate = 20 -- Inches per Minute
  local File = "C:\\Mach4Hobby\\GcodeFiles\\ProbeValues.csv" -- Path and filename to save the mapped points
 
  mc.mcCntlProbeFileOpen(inst, File, "%.3AXIS_X, %.3AXIS_Y, %.4AXIS_Z \n" ,true)  -- Open and format the file to write the XYZ coordinates

  wx.wxMessageBox("This will map the surface of a part and save the XYZ coordinates to the file.")
     
repeat

ProbeX = 0

-- Jog to Y probe Location
mc.mcCntlGcodeExecute(inst,"G90 G01 Y" ..ProbeY.. " F" .. JogRate)
coroutine.yield()

repeat
-- Jog to X probe Location
mc.mcCntlGcodeExecute(inst,"G90 G01 X" ..ProbeX.. " F" .. JogRate)
coroutine.yield()

-- Probe for Z
mc.mcCntlGcodeExecute(inst,"G91 G31.0 Z-" ..ProbeZdist .. " F".. ProbeRate) 
coroutine.yield()

mc.mcCntlGcodeExecute(inst,"G90 G01 Z" ..ProbeZ.." F" .. JogRate)
coroutine.yield() 
 
ProbeX = ProbeX + GridX

until (ProbeX > ProbeXmax + 0.001)

ProbeY = ProbeY + GridY
until (ProbeY > ProbeYmax + 0.001) 

mc.mcCntlProbeFileClose(inst) --close probe file

   
  mc.mcCntlSetLastError(inst, "Probing Complete")
 
  mc.mcCntlReset(0)

end)


Code: [Select]
-----------------------------------------------------------
--Coroutine ProbeSurface
-------------------------------------------------------------
if (ProbeSurface ~= nil) and (machState == 0) then --ProbeSurface exist and state == idle
local state = coroutine.status(ProbeSurface)
    if state == "suspended" then --ProbeSurface is suspended
        coroutine.resume(ProbeSurface)
    end
end

-David

23
About 25% of the time when starting Mach4 (3804), the settings for the ShuttlePro are not loaded. I have to restart Mach4 for the settings to load. And, sometimes, 2 or 3 times before the settings load. The settings are in the Machine.ini file even when the settings do not load. Is there a way to fix this behavior?

Thanks,
David

24
Mach4 General Discussion / Re: Mach4 Hobby Autotouchplate function
« on: March 25, 2019, 01:52:09 PM »
I don't think that the Mach4 TouchOff module is compatible with the CNC Router Parts Corner Finding Touch Plate. https://www.youtube.com/watch?v=XsoHyPgaDzo Is there a way to configure the TouchOff module for this touchplate?

I made a coroutine for finding the lower left corner of the work with a 1/4" diameter bit with the Corner Finding Touch Plate. It works great for me. I then follow with a second coroutine that sets the Z height to zero at the spoil board with another fixed touch probe with each tool.

It would make the TouchOff module a little more useful if it could be made to work with the Corner Finding Touch Plate.

Pages: « 1 2 3