Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: krsykes23 on November 21, 2011, 04:43:10 AM

Title: Auto Tool-Changer and LPT2
Post by: krsykes23 on November 21, 2011, 04:43:10 AM
Hi all.

As a relative novice (returning to hobby CNC after a few years!), I have a question about a recently purchased Auto Tool-Changer
and LPT2 port.  The ATC controller is from Sorotec Germany, although made by USOVO...

(http://www.usovo.de/shop/Tool-Changer-and-HF-Spindles/Tool-Changer-Systems/Controlling-Systems-Adapters/Controlling-System-STG101::541.html)

I have the Kress 1050 spindle and the tool-changer system.  I also have installed a second parallel port (LPT2).  The CNC controller is the simple but perfectly adequate 4 axis TB6560.

I have tested the STG101 ATC controller with a 9v battery and the two required functions work correctly.  That's the signal for the tool-changer on the Kress and the signal for the pivoting cover on the 6 way magazine...

http://www.usovo.de/shop/Tool-Changer-and-HF-Spindles/Tool-Changer-Systems/Tool-Holder-Magazine/Tool-Magazine-SK15-with-dust-cover::561.html

These are pins 14 and 16 at the STG101 controller.  As mentioned, they work fine when tested with the 9v battery.  

When I connect the STG101 controller to LPT2 and set the pins accordingly in Mach 3, sometimes it works but most of the time it doesn't!!   It is very random, although most of the time it doesn't work.  I have checked and double checked the settings in Ports & Pins but cannot find the reason why I have the problem.

I am also using the excellent 'Ultimate Screenset' from Mach Motion.  However, I have tried Mach 3's default 1024 screenset which makes no difference.

Any ideas on this problem would be most welcomed!

Keith
Title: Re: Auto Tool-Changer and LPT2
Post by: Tweakie.CNC on November 21, 2011, 05:59:11 AM
Hi Keith,

There is the possibility that your LPT2 parallel card puts out the 3.3 Volt TTL standard and your ATC controller requires the 5 Volt TTL standard.
Perhaps measure the voltage present on the Direction pin - it should be 5 Volts when jog in one direction and 0 Volts when jog in the opposite direction. There are a number of options you can take if only 3.3 Volts is present.

Tweakie.
Title: Re: Auto Tool-Changer and LPT2
Post by: krsykes23 on November 21, 2011, 06:11:21 AM
Thanks for the prompt reply.

I'll check the voltage shortly.  I was getting frustrated yesterday as to why it wasn't functioning.

You could well be right...as both functions work correctly with the test battery.

However, you advising testing the voltage at LPT2 by 'jogging'...I assume I'll need to set the appropriate
pins in the Ports & Pins for LPT2?  As currently, it's just set for the ATC controller (pins 14 and 16).

Keith
Title: Re: Auto Tool-Changer and LPT2
Post by: krsykes23 on November 21, 2011, 06:15:04 AM
BTW - Forgot to mention...stunning stuff on your website!

Keith
Title: Re: Auto Tool-Changer and LPT2
Post by: Tweakie.CNC on November 21, 2011, 06:28:27 AM
Hi Keith,

My mistake, I was thinking in terms of an axis - use whatever control you use to Enable / Disable the pin you are measuring.

Tweakie.

(Thanks for the complements - some of the stuff on the site is quite old now and I keep thinking I must update a lot of it  :-\ )
Title: Re: Auto Tool-Changer and LPT2
Post by: krsykes23 on November 21, 2011, 06:36:03 AM
Great,

So I assume I should hook my voltmeter to pins 14/16 of the LPT2 and the other to ground, and then check for +5v yes? 
I'll report back my findings later this afternoon.

Will the parallel cable length/quality make much difference?  I think it's about 2m or less, but only a simple
inexpensive type.

K
Title: Re: Auto Tool-Changer and LPT2
Post by: Tweakie.CNC on November 21, 2011, 07:01:28 AM
Yes - between pin 14 and GND (which is pins 18 to 25) should do it.
The cable length will make no difference for this test.

Tweakie.

nb. While you are testing check the cable to make sure you have the right type with Pin 1 connected to Pin 1, Pin 2 to Pin 2, etc
Title: Re: Auto Tool-Changer and LPT2
Post by: krsykes23 on November 21, 2011, 03:24:43 PM
Hi Tweakie

I have checked the voltage on the pins.  It's 5.05v.  It seems to be a bit erratic however.  The on/off is actually the 'Flood' switch, so
I can use this to operate.  I can't get Mach 3 to work though.

If I swap for the 9v battery again it works fine.  Just wondered if I should try a 5v battery.

One thing I did notice on the parallel cable was that on pins 15 and 16, there was also 5.05v, even when there shouldn't be??

Frustrated...yes!

K
Title: Re: Auto Tool-Changer and LPT2
Post by: Tweakie.CNC on November 22, 2011, 02:26:02 AM
Quote
One thing I did notice on the parallel cable was that on pins 15 and 16, there was also 5.05v, even when there shouldn't be??

That would concern me - it should cleanly switch between Hi and Lo in order to perform the correct logic function.
Perhaps you need to check that your LPT2 is configured and working properly as it sounds that you may have a problem here.

Tweakie.
Title: Re: Auto Tool-Changer and LPT2
Post by: krsykes23 on November 23, 2011, 03:51:04 AM
This is weird...firstly, I used a separate PSU instead of the 9v battery.  The voltage was 5.23v and this operated the relays
perfectly.

I thin decided to make up an LPT cable with only the wires required...ie, 25, 14 and 16.  Tested this with the 5.23v PSU and
it worked fine.

Connected the 3 wire LPT cable to LPT2 and the ATC controller, started up Mach3 and checked the Ports & Pins and then tested
the system.  

NOTHING!

Tested the voltage at pins 14 and 16 and it's as before...5.05v.  Back to the PSU or battery, and it works fine!

I have swapped LPT2 for LPT1 and reconfigured the Ports & Pins to port 1 but this doesn't work either.  

Would current have anything to do with it?
Title: Re: Auto Tool-Changer and LPT2
Post by: Tweakie.CNC on November 23, 2011, 04:29:15 AM
Quote
Would current have anything to do with it?

Yes.

You cannot drive a mechanical type of relay directly from the parallel port. You can drive TTL logic, solid state relays and some swithching transistors but i think the avaliable current limit is 10mA (if you are lucky).

Tweakie.
Title: Re: Auto Tool-Changer and LPT2
Post by: krsykes23 on November 25, 2011, 01:29:02 PM
I was wondering if there is a breakout board that I could use in between the LPT2 input and the STG101 controller?

If so, could you point me in the right direction as to which one would be suitable.  I haven't really studied breakout boards before!

Thanks
Title: Re: Auto Tool-Changer and LPT2
Post by: Tweakie.CNC on November 26, 2011, 02:37:36 AM
Have a look through the relay switching items here http://www.cnc4pc.com/Store/osc/index.php they are nice guys to contact and will promptly answer any questions relating to their products, if you have any.

Tweakie.
Title: Re: Auto Tool-Changer and LPT2
Post by: krsykes23 on February 05, 2012, 02:48:58 PM
Hi Tweakie,

I have now found that the LPT2 output didn't have enough current to drive the relays on the ATC controller.  I have 5.05v but wouldn't activate them.
So, I tried an older laptop with a parallel port.  Used the simple ParMon program to set pins 14 and/or 16 on/off.  It worked fine!!  So I knew it wasn't
the ATC controller at fault.  I recently tried something else...i have a spare TB6560 driver/stepper board, the same type that runs the motors, limits
and spindle etc.  So, I hooked this up temporarily to the PSU and LPT2 port.  I used the TB6560's onboard single relay (same one as I'm using for
my Kress spindle). I also connected one of the air solenoids to the relay on the TB6560 with 24v 

In Mach3, I set the P&P's accordingly....clicked Output 2 'On' in Mach3 and the relay activated!!

Now I'm getting somewhere.  I'm going to order a C36 BOB from Arturo, so that will replace the TB6560 used only for this test.

What I am now getting stuck with is, how do I activate the relay in the post processor?  I assume I'll use the Activate/DeActivateSignal(OutPut*********)
somewhere??  How do I get Mach3 to know that I have a second LPT port, with regards to the air solenoid.

I have looked on you website with interest, but it's losing me.

I have also got another question about a tool length sensor, but I'll post that in another thread.

Thanks

Keith
Title: Re: Auto Tool-Changer and LPT2
Post by: Tweakie.CNC on February 06, 2012, 03:24:02 AM
Hi Keith,

When you configure Mach Ports and Pins / Outputs you can set the Port# to 1 or 2 which then defines if it is your first or second parallel port.

The standard commands M3/M4 - M5  and M7/M8 - M9 would be probably be the easiest to use for switching your relays (that is what they were designed for) then your post- processor just has to insert these commands into your generated GCode at the appropriate place. (have another read through the Mach manual for details etc.). If you prefer to use the CB commands (Activate/Deactivate Signal) then you really need to study the CB manual to establish how CB and GCode can be combined effectively. It would take me forever to explain this properly but 99% of the details you need are in the manual.

Hope this helps.

Tweakie.
Title: Re: Auto Tool-Changer and LPT2
Post by: krsykes23 on February 10, 2012, 04:05:51 AM
Hi Tweakie,

I entered M7 (I think it was 7) in the MDI box…pressed enter and the MIST LED came on.  Looking at
MACH3 diagnostics screen, this is Output 4.  I need Output 2 and 3 to operate.

How do I tell the G Code to operate Output 2 and Output 3 on LPT2 (and any others I decide to use) and
then turn them off?

I'll use the MDI line for now, until I know what the Codes are.  You're right...I prefer to use M Codes as opposed to
VB and CB.  I'm getting there, but slowly!

Keith
Title: Re: Auto Tool-Changer and LPT2
Post by: Hood on February 10, 2012, 05:12:56 AM
You need to tell Mach that it is output 2 that you want  for Mist, its Config menu, Ports and Pins then Spindle setup. You can then enter Output 2 for M7 (Mist)
Hood
Title: Re: Auto Tool-Changer and LPT2
Post by: krsykes23 on February 10, 2012, 05:14:11 AM
Ah right...understood.  Thanks Hood!
Title: Re: Auto Tool-Changer and LPT2
Post by: Tweakie.CNC on February 10, 2012, 05:22:05 AM
Hi Keith,

The Output # associated with the M3,M4,M7,M8 commands are set under 'Config/Ports and Pins/Spindle Setup' then the output pin numbers associated with each Output# are set under 'Output Signals'.
Within your GCode the command M3 will turn on whichever Output# you have associated (as above) and M5 will turn it off (M3,M4 are turned off with M5 and M7,M8 with M9). I have not tried it but I think the command pairs are interlocked so you cannot select M3 and M4 at the same time (it has to be one or the other) and the same may apply it the M7 and M8 but try it and see.

Tweakie.
Title: Re: Auto Tool-Changer and LPT2
Post by: Hood on February 10, 2012, 05:26:58 AM
M7 and M8 can both be called at the same time, M3 and M4 can not, eg if you currently have M3 in effect calling M4 will cancel M3.
Hood
Title: Re: Auto Tool-Changer and LPT2
Post by: Dan Mauch on March 22, 2014, 01:20:07 PM
Can you send me a copy of the tool chnager macro. As I intend to pick up one of those tool changers.
Dan]