Hello Guest it is October 19, 2019, 06:53:23 PM

Author Topic: Mach3 turn atc  (Read 16550 times)

0 Members and 1 Guest are viewing this topic.

Re: Mach3 turn atc
« Reply #30 on: September 10, 2012, 02:05:28 PM »
unbelievable ,thank you so much.
well that just proves how useless i am at this sort of thing.
i will go and stand in the corner now

Offline Dan13

*
  •  1,244 1,244
    • View Profile
    • DY Engineering
Re: Mach3 turn atc
« Reply #31 on: September 10, 2012, 02:11:59 PM »
Glad it worked.

Although a T0 call is illegal, but just to prevent the turret from moving if a T0 gets issued somehow I would add an If conditional like this:

numtools = 99                                              'The number of valid tools
newtool = GetSelectedTool( )                                         'read the new requested tool

currenttool = GetOEMDRO(1000)                                     'user DRO 1000 is used to store the current tool. In this line assign whatever is in this DRO to the variable
While(currenttool< 1 Or currenttool > numtools)                'Check that currenttool contains a legal tool number.
currenttool = question("Please enter the current tool")       ' If not ask to enter the current tool in position.
Wend
SetOEMDRO 1000,newtool                                               ' Set user DRO 1000 to the new tool number

If (newtool > 0) Then                                     
                'Added this

dist = (newtool Mod 8 ) - (currenttool Mod 8 )                    ' the number of turret positions to move to the requested tool.

If (dist < 0) Then                                                            'Check if rollover needed
dist = 8 - Abs(dist)
End If

Code " G91 G0 A" & dist                                                  ' Move to the new turret position.
While IsMoving()
Wend
Code " G91 G0 A" & (-dist/5)                                           ' Reverse move to lock - set to 1/5th of one position and can be changed
While IsMoving()
Wend

Code "G90"                                                                  ' Set back to absolute mode. 

SetCurrentTool(newtool)

End If
Re: Mach3 turn atc
« Reply #32 on: September 10, 2012, 02:13:16 PM »
your a true gentleman
Re: Mach3 turn atc
« Reply #33 on: September 11, 2012, 11:55:00 AM »
numtools = 99                                              'The number of valid tools
newtool = GetSelectedTool( )                                         'read the new requested tool

currenttool = GetOEMDRO(1000)                                     'user DRO 1000 is used to store the current tool. In this line assign whatever is in this DRO to the variable
While(currenttool< 1 Or currenttool > numtools)                'Check that currenttool contains a legal tool number.
currenttool = question("Please enter the current tool")       ' If not ask to enter the current tool in position.
Wend
SetOEMDRO 1000,newtool                                               ' Set user DRO 1000 to the new tool number

If (newtool > 0) Then                                                     'Added this

dist = (newtool Mod 8 ) - (currenttool Mod 8 )                    ' the number of turret positions to move to the requested tool.

If (dist < 0) Then                                                            'Check if rollover needed
dist = 8 - Abs(dist)
End If

Code " G91 G0 A" & dist                                                  ' Move to the new turret position.
While IsMoving()
Wend
Code " G91 G0 A" & (-dist/5)                                           ' Reverse move to lock - set to 1/5th of one position and can be changed
While IsMoving()
Wend

Code "G90"                                                                  ' Set back to absolute mode. 

SetCurrentTool(newtool)

End If

hi all
ok i have the turret moving but not the correct amount. it takes 266 steps to get one full revolution in motor tuning.
in tool table i have setup some tools and asigned a degree in turret deg.
dose the turret deg relate to the position of the tool in the turret in degrees and if so why does the turret not move to this degree setting.
thanks in advance
« Last Edit: September 11, 2012, 11:57:12 AM by Hellfire »

Offline Dan13

*
  •  1,244 1,244
    • View Profile
    • DY Engineering
Re: Mach3 turn atc
« Reply #34 on: September 11, 2012, 01:33:39 PM »
Do not use the turret angle under Tool Table. You have to play with the Steps/Per in motor tuning till you get one index per one unit of A axis move. Enter in the MDI the following line:

G91 G0 A1

And play with the motor tuning till the above line advances the turret just the right amount. Also, change the reverse move line as I mentioned earlier.

Dan
Re: Mach3 turn atc
« Reply #35 on: September 12, 2012, 07:22:38 AM »
thanks Dan
Re: Mach3 turn atc
« Reply #36 on: September 13, 2012, 11:17:40 AM »
quick question, after the macro moves to the tool position and reverses does it reset the dro. what appears to be happining is when it reverses to lock i loose steps. then when i ask it to get the next tool it dosent quite make it.
cheers

Offline Dan13

*
  •  1,244 1,244
    • View Profile
    • DY Engineering
Re: Mach3 turn atc
« Reply #37 on: September 13, 2012, 12:04:54 PM »
Movement is incremental so lost steps should have no effect. May be you Steps per Unit setting is marginal. Try increasing it a bit.

Dan
Re: Mach3 turn atc
« Reply #38 on: September 13, 2012, 12:39:29 PM »
I have tried that, the problem is if i go to far it over shoots if choosing a tool more than 6 ahead.
It deffo seems to be loosing steps

Offline Dan13

*
  •  1,244 1,244
    • View Profile
    • DY Engineering
Re: Mach3 turn atc
« Reply #39 on: September 13, 2012, 01:00:16 PM »
I don't quite understand. Can you please be more specific and give more details about what is happening.

Dan