Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: 30t000 on April 23, 2010, 02:48:18 PM

Title: Adding DRO to MachTurn
Post by: 30t000 on April 23, 2010, 02:48:18 PM
I am just finishing off retrofitting my Boxford TCL125 . The turret I had originally taken off is now back on the machine . When I start up Mach3 , all the screens show only two axis as you would expect . I intend to drive the turret using the "Y" or even the "A" axis but alas there is no DRO , no homing button , and also I do not know how to drive it from the keyboard . I have turned the turret using MDI without a problem . I am also toying with the idea of using degrees instead of the normal linear coordinate system .

Can anyone advise on how to add a DRO and homing buttons etc and also tell me how to configure Mach3 so that I can drive the turret with the keyboard and maybe swap the linear units to angular . Please bear in mind that the explanation needs to be as simple to follow as possible please .

Many thanks for looking .
Title: Re: Adding DRO to MachTurn
Post by: Hood on April 23, 2010, 04:42:32 PM
You can use one of the screen designers to add DROs, buttons etc to a screenset, I like Screen4 but others prefer Machscreen.

How does your turret actually work as you should be able to configure Mach to change the tools automatically instead of having to press a button.

Hood
Title: Re: Adding DRO to MachTurn
Post by: 30t000 on April 23, 2010, 05:23:39 PM
Hi Hood ,

thanks for the rapid reply once again . Do the screen designers show you how to configure the keyboard ? The only reason to use the keyboard for the turret is just for setting up etc . Using the turret under program , I was going to write a small sub program and and every time I need to change tool I would call up the sub program . If you look at this thread you will get the idea . The only difference I would wish to do is change the linear programming to angular .

http://www.machsupport.com/forum/index.php/topic,4162.20.html

The turret has 8 positions and rotates in only one direction to advance to the next tool position . It then backs up on itself so that it locks up against a pawl .

I would dearly love to be able to use the turret using a macro so that the tool N° is always known . That way the programming will be easier because you wont have to remember where the last tool was . You could just say you want tool 3 for instance and it go straight to it . Unfortunately my knowledge of writing VB scripts is non-existent . I would need one written for me and then told how to place it in to Mach3 and use it .

Hope this helps .
Title: Re: Adding DRO to MachTurn
Post by: Hood on April 23, 2010, 05:38:01 PM
The screen design programmes are fairly easy to work out after you look at them for a while. Not really messed much with Mach Screen as I use Screen4 and it does all I need. It does have a few quirks that seem to catch the unwary off guard but doesnt bother me :)

I will look at that thread you linked to  in a minute but a macro should be easy enough to write, Do you have a home switch on the turret?
Hood
Title: Re: Adding DRO to MachTurn
Post by: 30t000 on April 24, 2010, 02:38:32 AM
Good morning Hood ,

no the turret does not have a homing switch , but if I can jog it to position 1 then I reference it then .
Title: Re: Adding DRO to MachTurn
Post by: Hood on April 24, 2010, 02:47:00 AM
I looked at that thread you linked to but seems the macro is no longer there for looking at.
However writing the macro shouldnt be too hard even for a VB thicko like me.
For your turret how exactly does it work,
Is it stepper driven?
Does the stepper stay energised all the time holding it against a pall?
Hood
Title: Re: Adding DRO to MachTurn
Post by: Hood on April 24, 2010, 02:48:30 AM
Oh another question, if a stepper how many microsteps does your drive have and is the motor 1:1 with the turret or is there gearing between?
Hood
Title: Re: Adding DRO to MachTurn
Post by: 30t000 on April 24, 2010, 03:11:53 AM
Here is the wording in the link .


Posts: 122


View Profile Email Personal Message (Offline)
   
   
Re: ATC for lathe
« Reply #22 on: September 11, 2007, 04:20:24 PM »
   Reply with quote
My Boxford TCL 125 has a ratchet type, stepper driven, 8 position turret. I used a simple G code subroutine to get it to index. Y axis was left as linear, (Mach doesn't care) and worked out the number of steps to get the 45 degrees. So the subroutine indexes the turret, say 50 degrees, then reverses the turret to stall the stepper against the ratchet (no problems the driver limits the current)
G code call is:-
M98 Ln P123 (Where n is the number of times I want to index and P123 is the subroutine.
Subroutine is:-
O123
G91 (Incremental distance mode)
G00 y-10 (Index more than 45 degrees)
G00 y2 (Back up to stall on ratchet)
G90 (Back to absolute distance mode)

M99 (Return from subroutine)

The Boxford turret has no means of telling Mach which tool it is using and because of the ratchet, it is strictly sequential.

I have not worked out the steps per degree yet and yes I believe it is geared . It is stepper driven with a microstepper . Yes the stepper remains energised although only on half power(switchable to full power if need be) . Again , if I can drive it manually through the keyboard it would be easier to figure out . The cursor keys are used for the x and z axis , but I'm still stumped as to what to use for the y axis .

Many thanks
Title: Re: Adding DRO to MachTurn
Post by: Hood on April 24, 2010, 03:22:07 AM
Ok here are the steps to try, I am assuming 2000 steps per rotation so you will need to adjust accordingly for your setup but basically its however many steps it takes to do one rev divided by 60.

1.   Enable the A axis and set it to the pins you have the turret connected to for Step and Direction
2.   In Motor Tuning select the A Axis and put  33.33333333 in the steps per unit box and 360 in Velocity (can go higher for this later) Not sure what you will need for accel, you will just have to mess with it to find whats best for your setup. Press save and exit motor tuning
3.   Go to Config menu and then System Hotkeys and click on  A++  and when the box appears press the key you wish to use for jogging. I would think maybe best to use PgUp as that should not be used by any other axis on a Lathe. Do the same for A—but use PgDn
4.   Go to Config menu then General Config and make sure A is set as rotational axis. Also choose the “Rot 360 Rollover” and uncheck the “Ang Short Rot on G0” and  “Rotational Softlimits”
5.   Rename the attached macro to M6Start.m1s and place   into your macro folder for the profile you are using, for example if you are using the standard Turn profile the folder to place it is C:\Mach3\Macros\Mach3Turn
6.   You should now be able to jog the axis with the PgUp button to get to tool 1 then reverse with PgDn to lock against the pall.
7.   Press Ref All button and your axis will home and A should be set to zero. Your other axis will also set to zero or if you have home switches fitted they will move to the switches and set zero (machine coords) so be aware of that.
8.   You should now be able to call T0202 from MDI and the turret will rotate to tool 2 and set the tool DRO to 2.

Get ready with the E-Stop for initial testing just in case things go wrong ;)

Hood
Title: Re: Adding DRO to MachTurn
Post by: Hood on April 24, 2010, 03:41:08 AM
Actually thinking about it that might not work with the reversing in the macro for tool 1 so be careful, I will do some testing later.
Hood
Title: Re: Adding DRO to MachTurn
Post by: Hood on April 24, 2010, 03:58:32 AM
Ok try it with this macro instead, remembering you will need to rename to M6Start.m1s before you place it in the macro folder of yourprofile.

Hood
Title: Re: Adding DRO to MachTurn
Post by: Hood on April 24, 2010, 04:27:34 AM
Oops typo in that last one, have tool3 twice, use this one instead.
Oh and also forgot to mention on General Config page you will need to set to Auto Toolchange option.
Hood
Title: Re: Adding DRO to MachTurn
Post by: 30t000 on April 24, 2010, 04:38:31 AM
Cheers Hood . I will have a stab at that tomorrow hopefully . Family things today unfortunately but at least I should be able to have a good stab at it tomorrow thanks to your kind help . You are a star sir . Thank you .
Title: Re: Adding DRO to MachTurn
Post by: Hood on April 24, 2010, 05:25:33 AM
The numbers in the macro might need tweaked a bit but see how it goes.
Might also be better to make the macro work in machine coords as well but will change that once you have tested things out so as not to pollute the thread with many different versions, already have too many due to my typos ;D
Hood
Title: Re: Adding DRO to MachTurn
Post by: 30t000 on April 25, 2010, 07:23:57 AM
Right , had a time to play this morning and done everything you suggested . It works fine in manual mode using page up and page down . The only thing I have a problem with is the toolchange through MDI . When you type in t0202 m06 the turret runs the wrong way i.e. it runs up against the pawl first . I do not know how to change this in Mach3 .  Apart from that it looks like jobsa goodun . :)
Title: Re: Adding DRO to MachTurn
Post by: Hood on April 25, 2010, 08:09:53 AM
Go to Config menu then Homing and Limits and choose the Reverse option for the A Axis.
Hood
Title: Re: Adding DRO to MachTurn
Post by: Hood on April 25, 2010, 01:39:11 PM
Just thought of another thing, I said to press the Ref All when your turret was homed but I dont think the standard Lathe screenset has such a button so you wont be able to do it.
Do you use the standard Turn screenset? if so I will quickly add a button for you and also a DRO if you wish. If you use a non standard screenset attach it and I will modify it for you.
Hood
Title: Re: Adding DRO to MachTurn
Post by: 30t000 on April 25, 2010, 02:38:17 PM
Cool . I do indeed use the standard screen set that comes with MachTurn . It does have a "Home All" button . Could it have a separate "Home" button like the other axis ? It does not have the third DRO though . To be honest , now that you've done a great job in sorting out the toolchanging macro for me , once I set the turret to position 1 and press the home all I should not need a DRO because the tool number will always be displayed . Although this does not take in to account moving it manually .
Just had a thought on the macro though . When you home the turret , tool 0 is displayed . I know this sounds daft , but when T0101 is called , will the turret turn 1 position . If so , it would actually be tool 2 . When you home the turret , can the tool N° be set to 1 ? Or does the macro take this into account ?
Title: Re: Adding DRO to MachTurn
Post by: Hood on April 25, 2010, 02:47:24 PM
When you call tool 1 the  macro will move to the changer to position 1 if its not already there, because you have set home as zero then it is indeed there so wont move but the Tool number DRO should update to tool 1. If that doesnt happen its no problem, I can make the home button for the changer a VB button and make it write 1 to the Tool number DRO.
Have you tried out the macro yet? I am thinking it may need some tweaking with the numbers and also I think it might be best to do the macro in machine coords .
Will go alter the standard screenset a bit, it wont be pretty but will at least get you working.

Hood
Title: Re: Adding DRO to MachTurn
Post by: Hood on April 25, 2010, 03:04:10 PM
Load this and see how it goes.
Hood
Title: Re: Adding DRO to MachTurn
Post by: 30t000 on April 25, 2010, 03:07:13 PM
No I'm afraid I have not tried it again today . The lathe is somewhere else which is more convenient for working on it , but not all that accessible because of time , wife , blah blah blah . It does not matter to me if it is not pretty . If it works that's good enough for me ! I won't be able to try it out again until possibly Tuesday or Wednesday evening . I have only to sort out the spindle problem I have at the mo and then I can get it home and all the rest of the tampering can be done at my leisure because I won't need to get in the back (I have a very small shed), but thats for another day . But first things first .


Title: Re: Adding DRO to MachTurn
Post by: 30t000 on April 27, 2010, 04:46:07 PM
Had a quick stab at the toolchange macro this evening . I swapped the 'A' axis as you said and that worked fine . I then tried the macro and asked it to go to T0202 from the place I'd homed it . It then cranked around past 2 stations and about two thirds the way to the next and stopped . It did not appear to try and reverse up to a pawl at all . I only tried it the once so you'll have to forgive the limited feedback I'm afraid . I only had a short amount of time .

I may be able to go and play tomorrow and will try and add the screen . First priority is to get my spindle working and then I can crack on with the "Finer" details . I am assuming I go in to the Mach folder and presumably navigate to a "Screens" folder and put it in there ? Will I need to rename as I did with the toolchange macro ? Also , will MachTurn then load straight to that screen each time I start it up ?
Title: Re: Adding DRO to MachTurn
Post by: Hood on April 27, 2010, 04:52:35 PM
Just place it in the Mach3 folder, then in Mach go to view then Load Screens. You will then need to select the file type, for Turn its lset, when you have done that you will see the screenset called 30t000.lset just double click it and after a few seconds it should load.

Now your turret problem, I would say you have the Steps per Unit set wrong, you need to find out how many revs of the stepper it takes to do one rev, also the amount of microstepping your drive has if any, you can then work out how many pulses you have for one rev of the turret and then divide by 360 to get per unit.
Hood
Title: Re: Adding DRO to MachTurn
Post by: 30t000 on April 27, 2010, 05:01:24 PM
Right , got it ta . The steppers are 1.8°and the drivers can go between 400 and something like 25000 microsteps . Once I get the DRO up and running , the rest will be easier to work out .

Once again , thank you .
Title: Re: Adding DRO to MachTurn
Post by: 30t000 on April 28, 2010, 05:27:32 PM
Right , had another go tonight and loaded the screen . That works fine thank you . The DRO gives angular coordinates which is fine . I tried the macro again and got the same result . I altered the steps per to 66.6666 and put the speed up to 2000 and it is almost there . just some fine adjustment now .  The only thing at the mo is that it does not quite reverse far enough . If you tell me what to look for in the macro I will sort it out  .

Many thanks once again my friend . It is great to have a forum with so much help . Bloody triffic . ;D
Title: Re: Adding DRO to MachTurn
Post by: Hood on April 28, 2010, 06:21:56 PM
In the macro you will see for each tool a line that has a negative value, for instance tool 1 will have Code("G0A-359") if you change that to Code("G0A-358") then it will move a degree more than previously.

Hood
Title: Re: Adding DRO to MachTurn
Post by: 30t000 on May 02, 2010, 10:28:09 AM
Got the macro to do as I was hoping but it still didn't work to well and then I realized that it is set up for 6 tools instead of 8 . I changed it and now it is almost perfect . Almost .
T0202 is called , the turret runs through 45° and reverses back to 43° and stalls before it gets there , which is what I want . The problem then arises when you then go on to the next tool . Because it thinks it is starting from 43° and it isn't .Can the DRO be set in the macro , after the toolchange , to tell the DRO what it should be reading ? That way it will avoid any cumalative errors .
Title: Re: Adding DRO to MachTurn
Post by: Hood on May 02, 2010, 11:20:53 AM
Yes, thought that may be the problem and was thinking machine coords would be the way to go but not sure how the rollover works with them so probably best just re-setting the offset like you say. All you will need to do is add a line before the End If for each tool, it will be

SetOemDRO(803,***)


Where the *** is the value you wish to enter.

Hood
Title: Re: Adding DRO to MachTurn
Post by: 30t000 on May 08, 2010, 11:38:41 AM
Whato Hood .

Right , had a really good mornings go at the machine today . I added the extra code as you suggested and it works a treat under MDI . I also had to change the starting and reversing angles to compensate for backlash etc , but again it works fandabbybloodydosy for me in MDI  ;D. I have not tried using it under program yet because I was busy setting up my spindle also . On the subject of which . If you have a single index pulse that gives accurate spindle speed , why would you need extra slots in a timing disc to give you spindle speed as well . Does the more slots you have make it more accurate ? It does not really matter to me now because I have managed to sort out my problems . I am just curious .

Anyway , I cannot thank you enough for your kind help . You are a gentleman sir .
Title: Re: Adding DRO to MachTurn
Post by: Hood on May 08, 2010, 12:11:06 PM
I believe Timing was added by Art a long time ago to try and sort out problems some people had with threading. It didnt make things more accurate and if I recall actually was fractionally worse but it did help some users that were having issues. Now however the timing has been done away with and can no longer be used for lathe threading, this was due to further updates Art did to the port driver for threading and by all accounts threading is working well for everyone. I use the SmoothStepper so none of that has affected me although I did have perfect threads with the parallel port before I started using the SmoothStepper.
Hood
Title: Re: Adding DRO to MachTurn
Post by: RICH on May 08, 2010, 05:43:34 PM
Quote
I am just curious

Timing was in a sense a way of trying to mimich an encoder and was limited depending on the number of slots and spindle rpm. Additionaly the info recieved was manipulated for the DRO display and was influenced by the particular pc being used. I would need to look through all my testing notes to
give you more specifics. ( frankly i would rather just forget the issues  ;D)

The single index was proven to be very accurate.
But....if you want electronic gearing then more resolution  / an encoder will need to be used, but before that could happen there are program changes and testing required, and that may come about in the future ;).... future defined as whenever :D......

RICH

Title: Re: Adding DRO to MachTurn
Post by: Hood on May 08, 2010, 06:10:28 PM
Here is what Art had to say on the subject a few years back.
Hood


Hi Guys:

Just to help clear confusion..

The INDEX input takes a one per revolution pulse. IT then calculates the speed
of the spindle from that timing,
and during a thread, calcuates if the timing from rotation to rotation slows. If
for example, the average rotation is 350us
prior to the actual motion of the thread.. ( Average time per rotation is
calculated when the spindle is on and no motion
is in effect ), and during a thread the time of one rotation is found to be
400us, this means that the last rotation took 50us
longer than the standing average ( a 14.28% slowdown) , then the axis motion is
slowed by 14.28% during the next rotation,
this repeats from rotation to rotation to end up with as near a perfect average
time of axis vs spindle rotation speed.

When using the TIMING input instead of the INDEX input, the system looks for
multiple pulses, but in particular looks
for a pulse 50% wider than the others. This 50% wider pulse is then considered
the INDEX, and the system does the
rotation speed calculation only from that pulse for the spiindle speed display.
However, the other pulses are counted, and
the total rotation time is divided by the number of pulses. SO lets say you have
4 pulses, one of which is 50% wider than the
rest. Any threading will begin on the widest pulse as the trigger, but the time
from pulse to pulse will be calculated and
compared to the total average time of rotation divided by the number of pulses.
The system will slow down axis motion to
correct for deviations between the pulses.

So more pulses will not give you a faster DRO update of rotation speed, but in
theory will correct more often for slowed
down rotations. Its been proven however, to have no advantage in the thread.
While a mathmatically theoretical advantage
exists in the multiple slot theory, any advantage gained seems to be lost in the
disadvantage of additional complexity of the
correction. There are several reasons for this internally and in the required
timing and math. My suggestion is to use  INDEX
and not  TIMING as a result. KISS is an important principle here IMO.

The SS is being written to use the INDEX method of timing sync at first, it
will then branch to encoder sync which is much
more exact and allows for things such as stopping a spindle and having a thread
stop and continue when the spindle is restarted.
This really required only a much higher granularity of timing than the PP
driver. TO sync to a encoder in the PP woudl require
the ability to vary the interrupt timer on granularities smaller than the
available 40us ones ( in 25Khz mode). Since the SS has
a 4MHZ maximum granularity, its much more possible to vary timing in smaller
increments thus matching exactly ( pretty much) with the varying encoder count
to count time. It is this granularity issue that guides the threading design in
current Mach3, and forces the consideration as above. By all that I mean if the
system determines a motion must slow to match a spindle, the PP driver has only
the power to create a bresenhamed output timing based on 40us granularity, the
SS could use a sub microsecond timing variation which would be invisable to the
end drivers. Any such correction can be thought of as purposely added jitter to
the output stream, Jitter slows the output stream by the required percentage but
causes a phase shift on the drivers output, so it must be kept low and the PP
driver is limited to 40us pulse to pulse variablity, usually thats much lower
than a driver can effectively see in its resultant phase shift, but in the SS
the timing jitter should be able to be much much smaller and totally invisable
to the driver which is the sought after end effect for a perfect threading sync.
Jitter, often thought to be a problem in pulsing output, is actually used as a
benificial effect in Mach3, and the amount of jitter is tightly controlled to
take advantage of its good effects, and keep it low enough to minimise its
negative effects on the drivers phase timing stability. All digital based output
timing has jitter, its a matter of understanding it and using it effectively. In
threading , Mach3 uses a system of control very similar to Mariss's look forward
trajectory smoothing technique, but it was developed long before that.

End analysis: stay with INDEX when using a PP unless you have some inherent
reason for trying the TIMING input. The theoretical advantages dont outweigh the
mathmatical disadvantages.


Thanks,
Art ( just a user who knows a little bit about timing. :-) )
Title: Re: Adding DRO to MachTurn
Post by: 30t000 on May 09, 2010, 04:26:57 AM
Clear as mud , but I did ask I suppose . I think I will definitely just stick to the index I think . I just love the way the software is trying to push it's boundaries and act like a "real" commercial controller . Its good stuff . I wonder if he will ever get around to using the Mac platform as well or if he'll just stick to pc's ?

Anyway thanks for the most comprehensive answers .
Title: Re: Adding DRO to MachTurn
Post by: Len-Tikular on February 20, 2017, 05:19:54 PM
You can use one of the screen designers to add DROs, buttons etc to a screenset, I like Screen4 but others prefer Machscreen.

How does your turret actually work as you should be able to configure Mach to change the tools automatically instead of having to press a button.

Hood
Hi Hood, I have just restarted the conversion of my TCL160. I have read the post re the tool changer.
What is the latest macro for it's operation.
I'm using the standard Mach turn screen set.
Many thanks
George