Hello Guest it is July 22, 2019, 05:27:59 PM

Author Topic: Inconsistant ATC Positioning  (Read 4830 times)

0 Members and 1 Guest are viewing this topic.

Re: Inconsistant ATC Positioning
« Reply #20 on: March 09, 2017, 07:10:36 PM »
Aha, that one  ::)
Re: Inconsistant ATC Positioning
« Reply #21 on: March 09, 2017, 08:02:30 PM »
I think your problem is real simple. You have a code block for every tool position. While G90 is modal and stays in effect if your progrsm uses a g91 anywhere your macro will fail. So just two things you need to check. Issue the G90 before every move in each of the 8 tool blocks of code. Then make sure each code block does a G0A0 for tool one, G0A45 for tool two, G0A90 for tool 3 and so on.

I see there is also code to reverse the travel direction for 2 degrees probably to set your position against a hard ratchet stop. I can't quite see how that works with a stepper motor as I think it could cause the motor to lose a couple of steps each time and the position will walk off over multiple tool changes. Might need to remove that code from each tool block if that happens.
Re: Inconsistant ATC Positioning
« Reply #22 on: March 10, 2017, 09:12:42 AM »
Tried that Garry, I put the G90 before each tool.

With the tool turret homed at Tool1
Calling T101, No movement
Calling T2, turret moves 45 Deg
Calling T3, turret moves 90 Degrees
Calling T4, Turret moves 135 Degrees
And so on,

The behavior is the same if Abs or Inc mode is selected
I'm still frazzled ???

George
« Last Edit: March 10, 2017, 09:26:57 AM by Len-Tikular »
Re: Inconsistant ATC Positioning
« Reply #23 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.
Re: Inconsistant ATC Positioning
« Reply #24 on: March 10, 2017, 11:58:13 AM »
Ok, RT

Macro attached.
I removed all the G90's as they did not have any effect.

To call a tool I just type into the MDI line

T101 for tool 1
T201 for tool 2
Etc etc.

I home the Tool turret first before selecting any tool.

I would be good if the turret homed before the turret moved to a new tool. That way it would always knows where it is. Once the tool is rotated beyond it's click position it would the rotate backwards against it stop
I have found that when I do home the turret it moves very very slowly ???

I also loaded a new screen that was posted, this screen included a DRO for the tool and has a 'Ref Turret' button.  I'm not sure if that would affect the operation of tool selection or not ???
Mach Turn has a 'Home all' button but this has no effect on the turret at all. ???

Ideally I would like to have the tool selection fully automatic and embedded in my Gcode file. I'm sure this has already been cracked by someone.

George
Re: Inconsistant ATC Positioning
« Reply #25 on: March 10, 2017, 04:15:01 PM »
Clearly you are still making incremental moves, from one position to the next.  Try:

If GetSelectedTool = 4 Then Code("G90G0A135") and see what happens.
Re: Inconsistant ATC Positioning
« Reply #26 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
« Last Edit: March 10, 2017, 05:37:21 PM by rhtuttle »
Re: Inconsistant ATC Positioning
« Reply #27 on: March 10, 2017, 06:24:52 PM »
Thanks RT, the peed setting is 1% in the config/homing limits.
Rot 360 rollover is checked

Your new Script fails with a Compile error/Syntax error at the first  ElseIf NEWTOOL > 8 Then
I'm using standard Mach3 script tool.

George
Re: Inconsistant ATC Positioning
« Reply #28 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
Re: Inconsistant ATC Positioning
« Reply #29 on: March 10, 2017, 06:41:54 PM »
What version of Mach3 are you running?