Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: Len-Tikular on March 01, 2017, 05:23:15 PM

Title: Inconsistant ATC Positioning
Post by: Len-Tikular on March 01, 2017, 05:23:15 PM
I'm having lots of trouble with my 8 Position Turret on my TCL160

I have searched the forums up and down in the hope of finding the correct information from what I can see, I think the M6start was written by Hood (Forgive me if I'm wrong)
Calling tools from the MDI line works for all the tools entered, however the movement of the Turret is inconsistent. Also If I enter G0 A360 I would expect the turret to rotate 360 Degrees, It doesn't.
I try repeated G0 A45 in an attempt to get the turret to rotate 45 degrees each time but I get inconsistent moves.
I also installed a Homing sensor to the turret but that does not seem to help, each time I home the Turret the DR) does not reset to 0 which is what I would expect?
It's sometimes behave as though it's a 6 tool turret ?
I have tried many variations of Steps/per in  motor tuning but that did not help, tried 33.33, 66.66 etc etc, no luck

I have attached both my XML and M6start files so if anyone can spare a wee bit time having a look I would be very grateful, someone out there has got a machine with an 8 way turret working correctly. If M6Start macro is not the best way, what is?

Many thanks

George

Where am I going wrong ??
Title: Re: Inconsistant ATC Positioning
Post by: garyhlucas on March 02, 2017, 05:18:46 PM
Are trying to rotate the turret in incremental mode or absolute? If incremental repeating A360 should cause a complete revolution each time in the same direction. If absolute mode and you are somewhere other than 360 it should move to 360 the first time you input A360 and not move the next time because you are already there. A45 in incremental moves you by 45 each time. A45 absolute takes you to 45 from wherever you are. Doing it again produces no motion.
Title: Re: Inconsistant ATC Positioning
Post by: Len-Tikular on March 02, 2017, 07:02:26 PM
Hi, Garry, I must be in incremental mode because the tool Turret moves with each command. Movement never seems to be the same? Sometimes 45 degrees others maybe 90? The dro reads ok but the movement of the turret does no necesserally match it.

George
Title: Re: Inconsistant ATC Positioning
Post by: garyhlucas on March 02, 2017, 10:24:04 PM
Turrets have rotational inertia. You could be loosing steps because your acceleration setting is too high. Try a low setting and see if the moves become consistent.
Title: Re: Inconsistant ATC Positioning
Post by: Len-Tikular on March 06, 2017, 05:29:26 PM
Turrets have rotational inertia. You could be loosing steps because your acceleration setting is too high. Try a low setting and see if the moves become consistent.

I'll give that a try,
Many thanks
George.

Title: Re: Inconsistant ATC Positioning
Post by: Len-Tikular on March 06, 2017, 05:30:31 PM
Turrets have rotational inertia. You could be loosing steps because your acceleration setting is too high. Try a low setting and see if the moves become consistent.

I'll give that a try,
Many thanks
George.



How do I check the Mode Gary, ??
Title: Re: Inconsistant ATC Positioning
Post by: Len-Tikular on March 06, 2017, 05:32:04 PM
Has anyone looked at my MSstart Macro or my MAch3XML file to see if I have any errors ??

George
Title: Re: Inconsistant ATC Positioning
Post by: garyhlucas on March 06, 2017, 06:29:58 PM
G90 is absolute and is modal (stays set) G91 is incremental and is also modal.
Title: M6start macro check please
Post by: Len-Tikular on March 07, 2017, 04:01:06 AM

I'd be grateful if someone could check the attached Macro for errors.

I'm getting inconsistent travel on my Boxford TCL160 8 position rotary tool turret.

Many thanks

George

Title: Re: Inconsistant ATC Positioning
Post by: rhtuttle on March 07, 2017, 10:23:29 AM
I don't have a turret to check out the movement (where's Hood when you need him ;) ) so I can't test it for you but some things to try

put a code "G90" at the beginning of the macro and see if you get the same behavior.  Eliminates some other code changing it to G91 mode.

If the error is repeatable then perhaps your steps per rev are messed up, unlikely.

If the movement is truly random then it is either mechanical, loosing steps from too great speed/acceleration or loose coupling, or electrical noise on the line.

My two cents.

HTH

RT
Title: Re: Inconsistant ATC Positioning
Post by: Len-Tikular on March 07, 2017, 01:22:10 PM
I don't have a turret to check out the movement (where's Hood when you need him ;) ) so I can't test it for you but some things to try

put a code "G90" at the beginning of the macro and see if you get the same behavior.  Eliminates some other code changing it to G91 mode.

If the error is repeatable then perhaps your steps per rev are messed up, unlikely.

If the movement is truly random then it is either mechanical, loosing steps from too great speed/acceleration or loose coupling, or electrical noise on the line.

My two cents.

HTH

RT


Thanks RT

I finally got it to rotate through 360 degrees by changing the 'Steps per' in motor tuning set to 167. This seems to be a very odd number for the steps per but it seems to work for my turret.
A Axis is set to Angular
ROT 360 rollover is checked
Distance mode is set to Inc checked

Turret moves 360 degrees each time with command G0 A360 repeatable
Also moves 45 degrees with G0 A45  repeatable

I don't have the option on my screen to 'ref all' but I do have a homing button for my A axis
I loaded a new screen to give the added dro for the turret but I'm not sure if it is working correctly.

I'm pretty sure that there is something amiss with the homing of the tool turret, I will try and fit a new homing sensor tomorrow.

George
Title: Re: Inconsistant ATC Positioning
Post by: rhtuttle on March 07, 2017, 02:36:22 PM
George,

Glad to hear it is coming along.

I am confused as to why you want distance mode set to Inc.  This means every time you issue a G0 A45 it will advance the turret 45 degrees not go to home + 45 degrees.  Some of your other gcode may override either distance mode by issuing a G90(absolute-go to dro position X) or G91(Inc-move an additional X amount)

Your macro assumes that you want to be in Abs mode so start by adding the code "G90" to your macro.  You can get fancy later and add to your macro, read and save the current mode, execute your current macro and then reset the mode back to what it was.

Let me know if I misunderstood you.
Title: Re: Inconsistant ATC Positioning
Post by: Len-Tikular on March 07, 2017, 06:14:41 PM
Thanks RT, I'll set distance mode to Abs and insert G90 to the Macro as advised and give that a go.
Without the G90 I was getting random movement on the turret, lets see how this goes tomorrow.

I have attached my Macro, lets see where I add the G90

I will fit a home sensor on the turret,
Should I set the home position with tool no1 in position ??
There re two other options, 'Auto limit overrides' and 'Override Limits', which of these should be 'Checked' ?//

George
Title: Re: Inconsistant ATC Positioning
Post by: rhtuttle on March 07, 2017, 06:31:14 PM
Anywhere before this:

If GetSelectedTool = 1 Then
Code("G0A0")
While IsMoving()
Wend
Code("G0A-358")
While IsMoving()
Wend
SetOemDRO(803,1)

End If  

I would change to:

Code("G90")
If NEWTOOL = 1 Then
  Code("G0A0")
  While IsMoving()
  Wend
  Code("G0A-358")
  While IsMoving()
  Wend
  SetOemDRO(803,1)
End If  

Title: Re: Inconsistant ATC Positioning
Post by: Len-Tikular on March 07, 2017, 06:36:57 PM
Thanks RT,

Is that a G90 to be included for each of the 8 tools in the macro ??
Title: Re: Inconsistant ATC Positioning
Post by: rhtuttle on March 07, 2017, 06:52:40 PM
No, not necessary.  G90 is what they call modal.  It stays that way until a G91 is issued changing the mode to incremental
Title: Re: Inconsistant ATC Positioning
Post by: Len-Tikular on March 08, 2017, 12:08:24 PM
OK RT here's what I did,
Here's what I did.

I set distance mode to ABS
I checked the Rot 360 rollover box
I set A axis to angular
I placed a G90 directly after Get Selected tool =1

I homed the Z axis this was fine.
I don't have a 'Home' button for the A axis However I can home the axis by pressing the 'ref turret' button. The axis does ref to the sensor but very slowly ??? Once it hits the sensor then it backs of 1 degree.
If I move the turret and the Z axis away from the home position and then do a 'Home all' the Z axis returns to the home position set but the A axis does not move at all ???

Ok from the turret at home I then input via MDI
G0 A45 Turret moves 45 Deg
Input G0 A45 again, turret does not move
Input G0 A90 , turret moves to an additional 45 Deg
Input G0 A135, turret moves to an additional 45 Deg
And so on through to 360 Deg.

That seemed to work fine but heres the odd bit.

From the A axis home position,
Input T201 turret moves 45 Deg this seems ok
Input T301 turret moves an additional 90 Degrees, in other words it skips a tool.
Input T401 turret moves an additional 135 Degrees, now it skip 2 tools
Input T501 turret moves an additional 180 Degrees, now it skips 3 tools.

And so on....

I now set distance mode to Incremental and with each entry of G0 A45 the turret moves 45 Degrees each time, this seems correct.
I ref the turret again, now sitting at tool No1
T101 , no move
T201 moves past tool No2 then backs against it's stop, this seems good
T301 move 90 skipping a tool
T401 moves 135 skipping 2 tools
T501 moves 180 skipping 3 tools.
Clearly some wrong with my M6 macro or my setup,

I'm frazzled so I need some help.

Regards

George

Title: Re: Inconsistant ATC Positioning
Post by: rhtuttle 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
Title: Re: Inconsistant ATC Positioning
Post by: Len-Tikular on March 09, 2017, 08:58:01 AM
Hi RT,
The screen set was designed by another user, it may have been Hood but I'm not sure. So I don't know if the homing of the A axis was included.

I cant find in ports and pins where to select the homing option ???

My macro should only be testing for 8 tools ?? Did I post the wrong one ?

George
Title: Re: Inconsistant ATC Positioning
Post by: rhtuttle 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.
Title: Re: Inconsistant ATC Positioning
Post by: Len-Tikular on March 09, 2017, 07:10:36 PM
Aha, that one  ::)
Title: Re: Inconsistant ATC Positioning
Post by: garyhlucas 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.
Title: Re: Inconsistant ATC Positioning
Post by: Len-Tikular 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
Title: Re: Inconsistant ATC Positioning
Post by: rhtuttle 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.
Title: Re: Inconsistant ATC Positioning
Post by: Len-Tikular 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
Title: Re: Inconsistant ATC Positioning
Post by: garyhlucas 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.
Title: Re: Inconsistant ATC Positioning
Post by: rhtuttle 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
Title: Re: Inconsistant ATC Positioning
Post by: Len-Tikular 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
Title: Re: Inconsistant ATC Positioning
Post by: rhtuttle 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
Title: Re: Inconsistant ATC Positioning
Post by: rhtuttle on March 10, 2017, 06:41:54 PM
What version of Mach3 are you running?
Title: Re: Inconsistant ATC Positioning
Post by: Len-Tikular on March 11, 2017, 10:05:42 AM
Good news,

Homing is much faster  ;D
Tool selection calling t101, t201 t301 etc from the command line now work  ;D I owe you a beer.

Now going on  :P

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'm a bit confused about tis.
Also when I home the turret I have placed my sensor in such a position that the turret moves past the tool required, Is this correct ? and if so can it then be instructed to back against the stop ???

I'm grateful to you for your help and to all others too.

George
Title: Re: Inconsistant ATC Positioning
Post by: rhtuttle 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

Title: Re: Inconsistant ATC Positioning
Post by: Len-Tikular on March 11, 2017, 01:20:05 PM
I think you're right RT, I will drive past the tool position and drive a few degrees against the stop.

I'll report back tomorrow.

Thanks

George
Title: Re: Inconsistant ATC Positioning
Post by: Len-Tikular on March 11, 2017, 03:45:23 PM
I think you're right RT, I will drive past the tool position and drive a few degrees against the stop.

I'll report back tomorrow.

Great, I've done as you suggested and with a bit of twiddling it works just fine.

One final thing and I think I'm there,
When I ref the turret the DRO may have some information other than Zero and the tool number may not be No1
Can the Turret DRO and tool number be set when referenced ?

Thanks

George
Title: Re: Inconsistant ATC Positioning
Post by: Len-Tikular on March 12, 2017, 04:45:02 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



I think you're right RT, I will drive past the tool position and drive a few degrees against the stop.

I'll report back tomorrow.

Great, I've done as you suggested and with a bit of twiddling it works just fine.

One final thing and I think I'm there,
When I ref the turret the DRO may have some information other than Zero and the tool number may not be No1
Can the Turret DRO and tool number be set when referenced ?

Thanks

George