Hello Guest it is April 19, 2024, 07:42:32 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 - thespindoctor

Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 »
141
Mach4 General Discussion / Re: file i/o
« on: April 02, 2017, 11:32:10 AM »
Got it?   TRUE is not valid but true is...  case sensitive!

Also  \\ double slashes is correct so this below worked great

mc.mcCntlProbeFileOpen(inst, "C:\\mach4Hobby\\GcodeFiles\\KFCProbeValues.csv","%.4AXIS_ %.4AXIS_Y\n", true)

only problem is that the G31 move will only run twice in a row then it kicks out...

142
SmoothStepper USB / G31 will run twice only
« on: April 02, 2017, 11:28:37 AM »
g31 will only run 2 times.  Is this a bug in the ess plugin??


Quote

inst = mc.mcGetInstance()

mc.mcCntlGcodeExecuteWait(inst,"G90G00 X-4.2 Y-.6") --position at beginning at pin setpoint

mc.mcCntlProbeFileOpen(inst, "C:\\mach4Hobby\\GcodeFiles\\KFCProbeValues.csv","%.4AXIS_ %.4AXIS_Y\n", true)

     mc.mcCntlGcodeExecuteWait(inst,"G31 Y-.65 F20.0")
     mc.mcCntlGcodeExecuteWait(inst,"G91G00 X-.1 Y.07")
     mc.mcCntlGcodeExecuteWait(inst,"G90")

     mc.mcCntlGcodeExecuteWait(inst,"G31 Y-.65 F20.0")
     mc.mcCntlGcodeExecuteWait(inst,"G91G00 X-.1 Y.07")
     mc.mcCntlGcodeExecuteWait(inst,"G90")

     mc.mcCntlGcodeExecuteWait(inst,"G31 Y-.65 F20.0")
     mc.mcCntlGcodeExecuteWait(inst,"G91G00 X-.1 Y.07")
     mc.mcCntlGcodeExecuteWait(inst,"G90")


mc.mcCntlProbeFileClose(inst) --close probe file


143
Mach4 General Discussion / Re: G31
« on: April 02, 2017, 11:21:40 AM »
However, I can't get the probing G31 to work more than 2 times in a row.  Just posted that code.

144
Mach4 General Discussion / G31 will run twice only
« on: April 02, 2017, 11:20:17 AM »
This code seems correct.  No matter what I try, I can only get 2 probe moves.  It does the same thing in a loop with only 2 iterations then bombs out.    
The file is opening and 2 lines of x and y position are recorded correctly.  It will not do the third block.  The screen blinks at the end of the second block.
Any code after the second block is skipped so no message etc can be displayed.

Why is it aborting like this?

Quote

inst = mc.mcGetInstance()

mc.mcCntlGcodeExecuteWait(inst,"G90G00 X-4.2 Y-.6") --position at beginning at pin setpoint

mc.mcCntlProbeFileOpen(inst, "C:\\mach4Hobby\\GcodeFiles\\KFCProbeValues.csv","%.4AXIS_ %.4AXIS_Y\n", true)

     mc.mcCntlGcodeExecuteWait(inst,"G31 Y-.65 F20.0")
     mc.mcCntlGcodeExecuteWait(inst,"G91G00 X-.1 Y.07")
     mc.mcCntlGcodeExecuteWait(inst,"G90")

     mc.mcCntlGcodeExecuteWait(inst,"G31 Y-.65 F20.0")
     mc.mcCntlGcodeExecuteWait(inst,"G91G00 X-.1 Y.07")
     mc.mcCntlGcodeExecuteWait(inst,"G90")

     mc.mcCntlGcodeExecuteWait(inst,"G31 Y-.65 F20.0")
     mc.mcCntlGcodeExecuteWait(inst,"G91G00 X-.1 Y.07")
     mc.mcCntlGcodeExecuteWait(inst,"G90")


mc.mcCntlProbeFileClose(inst) --close probe file


145
Mach4 General Discussion / Re: G31
« on: April 02, 2017, 08:31:11 AM »
I have an ess mocontrol board and the code you used works perfectly for my machine!  Your code just catapulted my understanding a leap forward.  That use of the error box is great!

I now can move on with learning how to probe and understanding Lua etc using my own code with G31!!

I guess you have an issue with Pmdx!

146
Mach4 General Discussion / Re: probing with do loop
« on: April 02, 2017, 06:28:03 AM »
That makes sense.  What about the idea of taking the probesinglesurfy function from the module and copying it then adding the code to write to the probe file and then moving and looping within the new function?

I don't understand G31.  Is there any Doc for G31 in Mach?

Thanks!

147
Mach4 General Discussion / probing with do loop
« on: April 01, 2017, 06:54:40 PM »
Using a do loop to repeat a probing action but in the loop it does not work properly, not sure why

This is the code from the probe a single Y surface from the probing screen. I have just added a loop to increment an X axis move.  The code preceeding is not shown but remains as it was written by the coding Guru...

Quote

local iter
local travel = -4.2

for iter = 1, 100 do

 local rc = mc.mcCntlGcodeExecuteWait(inst, "G00 X"..travel)
        mm.ReturnCode(rc) 

    prb.SingleSurfY(ypos,work)

    travel=travel-.1

end


Quote
prb.SingleSurfY(ypos,work)  -- works fine when used alone without the other code to loop and increment X


148
Mach4 General Discussion / Re: file i/o
« on: April 01, 2017, 06:43:01 PM »
I don't understand the M401 code but how about this?  It still does not write to the file during the probe operation.
Quote

local path="c:\\Mach4Hobby\\Modules\\KFCProbeFile.csv"
mc.mcCntlProbeFileOpen(inst, path, "%.4Axis_X, %.4Axis_Y", TRUE)


Thanks Craig

149
Mach4 General Discussion / file i/o
« on: April 01, 2017, 06:05:43 PM »
Why does this fail with error that the file cannot be created?
Not sure how to open and close files for probe data.

Quote

local rc=mc.mcCntlProbeFileOpen (inst, "KFCProbeFile.csv", "%.4Axis_X, %.4Axis_Y", TRUE)

local rc=mc.mcCntlProbeFileClose(inst)


Thanks

150
Mach4 General Discussion / Re: Simple Lua question
« on: April 01, 2017, 03:46:47 PM »
It is working great now.   Just took the code

Quote
local rc = mc.mcCntlGcodeExecuteWait(inst, "G0 X-4.0")
   mm.ReturnCode(rc)

Now I  have control over Gcode in Lua.   Got probing with stepover repeating using a do loop.  Now to learn file I/O

Feeling better...

Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 »