Hello Guest it is April 25, 2024, 01:44:54 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 - rhtuttle

461
General Mach Discussion / Re: Inconsistant ATC Positioning
« on: March 11, 2017, 11:01:43 AM »
Quote
When the required tool is selected and the turret rotates I need it to run back against it's stop for every tool selected, when it's there then the DRO needs to be reset maybe

I don't know what is 'right' but if that is what you want to do then in each place where I commented out the line like this one for tool 4:

REM    SetOemDRO(803,4)

you would remove the REM and change it to:

   SetOemDRO(803,135)

I assume you are using stepper motors and backing up against the stop until the stepper loses steps. then I guess this would work.  Personally I would make your moves
G0 A138
while isMoving()
wend
G0 A135

No need to then reset the DRO.


Like I said I don't have a turret so I don't know what the proper way to use it.

Good luck

RT


462
General Mach Discussion / Re: Inconsistant ATC Positioning
« on: March 10, 2017, 06:41:54 PM »
What version of Mach3 are you running?

463
General Mach Discussion / Re: Inconsistant ATC Positioning
« on: March 10, 2017, 06:39:31 PM »
George,

If the speed setting is 1% then that is why your turret ref is so slooooow.  Change it to higher number!


I can only assume that you copy and pasted the code incorrectly so I have attached the file.  It runs in my editor

464
General Mach Discussion / Re: Inconsistant ATC Positioning
« on: March 10, 2017, 05:34:17 PM »
Hi George, got any hair left?

First, in config ->homing/limits, check to see what 'Speed %' you have for the A axis.

Second, the screen set you are using is custom.  In your code you keep setting  DRO 803 to the new tool number.  that is the A axis dro not the current tool number.

I have taken your code and modified it a bit and it works for me when I step through it.  See if it works for you.  I have commented out the second line which I used to test it in the script editor.  If you want to step through with the editor debugger just take the REM out , step through it(don't try to step while it is moving the  dro wait until it stops) when done you should see the dro at the right angle and the tool numer changed in the box right and below.  Change the NEWTOOL number and test again.

Code: [Select]
NEWTOOL = GetSelectedTool()
REM NEWtool = 4
If NEWTOOL = GetCurrentTool() Then  ' If the tool called for is the same as already in then toolchange ignored
  NEWTOOL = NEWTOOL
ElseIf NEWTOOL > 8 Then            'If tool called is greater than 8 then code is stopped and message telling you why is displayed
 DoOemButton(1003)
 MsgBox("Tool number too high, file will rewind")
 DoOemButton(1002)
ElseIf NEWTOOL < 1 Then            ' If tool called is less than 1 then code is stopped and message telling you why is displayed
 DoOemButton(1003)
 MsgBox("Tool number too low, file will rewind") 'Tool number called is too high so code will stop and rewind so editing can take place
 DoOemButton(1002)
Else
  code("G90")
  If NEWTOOL = 1 Then
    Code("G0A0")
    While IsMoving()
    Wend
    Code("G0A-358")
    While IsMoving()
    Wend
REM    SetOemDRO(803,1)
  ElseIf NEWTOOL = 2 Then
    Code("G0A45")
    While IsMoving()
    Wend
    Code("G0A-43")
    While IsMoving()
    Wend
REM    SetOemDRO(802,2)
  ElseIf NEWTOOL = 3 Then
    Code("G0A90")
    While IsMoving()
    Wend
    Code("G0A-88")
    While IsMoving()
    Wend
REM    SetOemDRO(803,3)
  ElseIf NEWTOOL = 4 Then
    Code("G0A135")
    While IsMoving()
    Wend
    Code("G0A-133")
    While IsMoving()
    Wend
REM    SetOemDRO(803,4)
  ElseIf NEWTOOL = 5 Then
    Code("G0A180")
    While IsMoving()
    Wend
    Code("G0A-178")
    While IsMoving()
    Wend
REM    SetOemDRO(803,5)
  ElseIf NEWTOOL = 6 Then
    Code("G0A225")
    While IsMoving()
    Wend
    Code("G0A-223")
    While IsMoving()
    Wend
REM    SetOemDRO(806,6)
  ElseIf NEWTOOL = 7 Then
    Code("G0A270")
    While IsMoving()
    Wend
    Code("G0A-268")
    While IsMoving()
    Wend
REM    SetOemDRO(803,7)
  ElseIf NEWTOOL = 8 Then
    Code("G0A315")
    While IsMoving()
    Wend
    Code("G0A-313")
    While IsMoving()
    Wend
REM    SetOemDRO(803,8)
  End If
  SetCurrentTool(NEWTOOL)       ' Set Tool number DRO to new tool
End If
    

In config->general Config make sure that 'Rot 360 Rollover' is ticked and that 'Ang Short Rot on G0' is not ticked.
If this doesn't do it I am at a loss.

HTH

RT

465
General Mach Discussion / Re: Inconsistant ATC Positioning
« on: March 10, 2017, 10:41:21 AM »
George,

I think it's time to re-post the the macro and the code you are using to call the macro.

466
General Mach Discussion / Re: Question on Xbox 360 Plug-In on Mach 3
« on: March 09, 2017, 06:39:24 PM »
On my machine that button says GOTO Z and it is not an editable button.  You may be using a custom screen so select operator->Edit Button Script and see if that button blinks meaning it is editable.  If so check out the code there.

On the stock screen like mine that button means to go to safe z as defined in your config.  If that is what you want to do or if you find in the button script on yours   doOEMButton(some number) then for your xBox A button select OEM Button #1 and then on the left side enter either the cutom button code from your button script or 17 for safeZ  in the Custom OEM Code #1

Otherwise write a macro and select custom Macro#1 and fill the macro number on the left.

HTH

RT

467
General Mach Discussion / Re: Inconsistant ATC Positioning
« on: March 09, 2017, 06:24:24 PM »
Ports and Pins->input signals
A Home enabled would be a green check mark
Just like you did for x and z axis.

468
Mach4 General Discussion / Re: Lua Macro Parameters
« on: March 09, 2017, 12:27:01 PM »
Thank you all for your guidance on this issue.

Daz, the loadScreen path and the load_modules paths are exactly the same.

I don't understand why but the loadScreen found and loaded the module but the load_modules failed because there was no
mach4 dir/profiles/my profile/modules folder.

Once I created the modules folder under the profile folder it worked.

I haven't tried it yet but I assume if I eliminated that as part of the package altogether it would have worked.

RT
 

469
Mach4 General Discussion / Re: Lua Macro Parameters
« on: March 08, 2017, 05:33:29 PM »
Chaoticone, sorry for mangling your name in my previous post.  Thanks for the file, deleted the lines:

package.loaded.mcErrorCheck = nil
ec = require "mcErrorCheck"

since I don't have that module either.

Still no joy.

Code: [Select]
function m9002()
 local inst = mc.mcGetInstance()
 mc.mcCntlGcodeExecuteWait(inst,"g1F4 x1")
 if rt==nil then
    wx.wxMessageBox("rt==nil")
  else
    rt.rtMessage('Another Hello')
 end
end

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

When I call this macro from a button or through the mdi the dros move correctly and then I get the message rt==nil
If I call rt.rtMessage("Button Message") from a button I get 'Button Message'   so the GUI lua is loading the rtModule and seting it's rt but the load_modules.mcs for macro rt must be failing to load the same module as the screen.  How can you debug this?  

Has anyone tested this with Mach4Lathe?  

The UC100 plugin failed because they hadn't tested it with lathe so lathe must have some different code.

TIA

RT

470
General Mach Discussion / Re: Inconsistant ATC Positioning
« on: March 08, 2017, 03:26:38 PM »
I'm right there with you on the frazzle meter.  I need help with Mach4 and have been chasing my tail for 2 days.

With regards to the ref all not moving your turret, did you change the ref all button code to include homing the turret as well as X and Z?  Looks like you can't change the ref all in the lathe screen set, sorry.  They must be using OEMbutton(105).  In the ports and pins inputs is your turret axis homing enabled?

Like I said I don't have a tool changer so I'm shooting in the dark here.  From your last post when you are calling the M6 macro with a T401, my understanding is that there is a maximum number of tools at 253.  Your previous code that you posted only tests for tools 1 through 8. 

RT