Hello Guest it is March 29, 2024, 05:35:14 AM

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - CNCwt

Pages: 1
1
VB and the development of wizards / Macro VB Script for Lathe Toolchanger
« on: December 20, 2007, 09:43:26 AM »
Hi,

I need HELP on the Macro VB Scripting for the Lathe Toolchanger below.

This is a rather long description but hope it will help others as well doing the same type of VB Script.

I have a 4-position lathe toolchanger that uses 4 sensor switches to detect its position. I have made an electronic circuit to onvert the 4 positions (decimal) into 2-bit binary (00, 01, 10, 11) and then input these into the parallel port INPUT Pins. Here are the detailed description of the setup:

A)   Turret Tool Post & Relays:
a)   The Turret is a 4-position tool post driven by a 50W AC Motor.
b)   The AC Motor can be rotated CW or CCW controlled by 2 “ICE CUBE” Relays.
c)   The relays have 24VDC coils, Contacts of 3A/30VDC and 3A/240VAC.
d)   The 2 relays are interlatched.[/li]

B)   Tool Position Sensors:
a)   The 4 positions of the turret tool post are sensed by 4 installed hall-effect sensors or switches. The hall-effect sensors can be powered with 24VDC though I used 5VDC.

C)   Electronic Circuit and INPUT/OUTPUT controls using the parallel port:
a)   The electronic circuit was made feasible with the help of John Pearson (aka CJMerlin) without which, this will not be possible.
b)   The 4 hall-effect sensors (switches) are fed into an electronic circuit board and converted into 2-bit binary signals (Decimal Position 1, 2, 3, & 4 are converted into Binary 00, 01, 10, & 11).
c)   The 2-bit binary signals are inputted into 2 INPUTs of the Parallel Port (say, INPUT Pins #13 & #15) and set in Mach3 as INPUT2 & INPUT3.
d)   Mach3 is supposed to sense or monitor the 2 INPUTs and using Macro, Mach3 will know when a particular tool no. has just been sensed.
e)   Using an electronic circuit, 2 OUTPUTs of the Parallel Port are used to trigger the 2 relays of the tool post’s motor. One of the relay is to rotate the tool post CW and the other relay is to rotate the tool post CCW. Let’s say Parallel Port OUTPUT Pins # 6 & #7 and set in Mach3 as OUTPUT2 & OUTPUT3.
f)   Also, the above mentioned circuit interfaced the 5VDC TTL of the parallel port OUTPUT to 24VDC of the coil.

D)   How the auto turret tool post works:
a)   Let’s make the assumption that Tool # 3 is to be used.
b)   The GCode will specify T0301 (Txxyy where xx is the tool no.and yy is the tool offset) or this can be put in manually in MDI.
c)   A Macro will then monitor what is the present tool # in position. This function will be that of Mach3 reading the INPUT  # 2 & 3 to know which tool # is in position.
d)   If the correct tool # (Tool # 3) is in position, no further action will be taken and the rest of the GCodes are executed.
e)   If the required tool # is not in position, thru the Macro, Mach3 will send out a logical high signal pulse to OUTPUT2 and triggers RELAY #1 to raise and turn the turret CW.
f)   By so doing, the tool post will rotate until such a time that Mach3 senses thru the INPUT2 & INPUT3 that the required tool # has just rotated past the sensor.
g)   When Mach3 sensed that the required tool # has just rotated into position, it will send thru OUTPUT2 a logical low and thus stop the tool post’s CW rotation. It will next send a logical high thru OUTPUT3 to trigger RELAY #2 and thus rotate the tool post CCW and lock the tool post by lowering it into position.
h)   Mach3 will next send, thru Macro, a logical low to OUPUT3 to stop RELAY #2 and thus stop the motor of the tool post (say, within 1 second).

E)   The DECIMAL to BINARY relationship and proposed Macro equation to identify the tool position are as follows:
a)   The DECIMAL to BINARY is based on the following:
Tool Position No.       2-bit Binary
(Decimal)   (INPUT2)   (INPUT3)
                       B                    A
1                      0                   0
2                      0                   1
3                      1                   0
4                      1                   1

Below are the pictures of the Lathe and tool changer turret I am working on:

2
This is our SR-X3 CNC MILL on display during the China Machineries Exhibit in Manila last June 7-9, 2007. This is a system integration of the Sieg CNC-ready mill and the Mach3 software controller. It was the first small cnc mill introduced in the Philippine market as well as the official launching of the Sieg cnc-ready mill and Mach3 software controller.

Pages: 1