Denford Orac Turret working on Mach 3 macro

All info relating to the Denford ORAC CNC lathes

Moderators: Martin, Steve, Mr Magoo

User avatar
Denford Admin
Site Admin
Posts: 3632
Joined: Fri 10 Feb , 2006 12:40 pm
Hardware/Software: Go to User Control Panel > Profile
Enter as much information about your CNC hardware and software as you can - it makes it easier for everyone to know what you're talking about then.
Location: Sunny Brighouse
Contact:

Re: I need help with an 8 station Orac Tool Turret

Post by Denford Admin » Mon 20 Feb , 2012 9:48 am

Thanks for taking the time to share this info :)

angel-tech
CNC Guru
CNC Guru
Posts: 525
Joined: Tue 14 Nov , 2006 12:12 pm
Hardware/Software: .....
4 Quatros
3 Oracs
2 Easiturn atc
12 station lathe atc
Mach 3
Location: Quatroland

Re: I need help with an 8 station Orac Tool Turret

Post by angel-tech » Mon 20 Feb , 2012 15:55 pm

Max, could it be possible to get the macro to look at the pins and wait for the correct code before stopping the turret motor, rather than a set movement time.

vandal968
Posts: 20
Joined: Wed 08 Dec , 2010 11:21 am
Hardware/Software: EasiMill 3; Orac

Re: I need help with an 8 station Orac Tool Turret

Post by vandal968 » Mon 27 Feb , 2012 2:49 am

Thanks Max, this was just what I needed.

cheers,
v

vandal968
Posts: 20
Joined: Wed 08 Dec , 2010 11:21 am
Hardware/Software: EasiMill 3; Orac

Re: I need help with an 8 station Orac Tool Turret

Post by vandal968 » Mon 27 Feb , 2012 18:37 pm

Guys,
I'm mostly-working now. Maybe we can fine-tune this a bit. In Max's macro, the input #'s that were chosen are in the opposite order from what Denford used. So:

Sensor Lead REF Macro
outer blue E Input3
middle white F Input2
inner mauve G Input1

Let's see how badly that chart gets mangled...

I changed the inputs so that the Macro uses them in the same sequence as Denford did to reduce confusion. Also, on my turret (made in 1990), the logic has been changed. For example, in the posted logic diagram, tool 1 is 1,1,1 but on mine tool 1 is 0,0,1. This is not a case of my encoder disc being shifted, or reading the wires wrong, I've double-checked and Denford clearly made a change. Here is the logic on this newer turret (outer, middle, inner):

T1: 0,0,1
T2: 1,0,1
T3: 1,1,1
T4: 0,1,1
T5: 0,1,0
T6: 1,1,0
T7: 1,0,0
T8: 0,0,0

I had to clean the sensors and optical disc to get my changer working properly, before cleaning, only the first sensor was triggering properly, the other two were stuck "on".

Angel-tech,
you asked about dumping the movement time. I know nothing about VBSCRIPT, but it appears that an apostrophe marks a comment, and if so, the timing reference appears to be commented out:

'Code "G4 P4.0" 'Wait for the tool to rotate past the sensor

I've got two issues currently. First, the sensor state changes the moment the turret reaches the new position, and NOT after triggering the ratchet. So, for me, it rotates to the correct tool then backs up all the way to the previous tool. So it looks like I need the timing delay enabled in my version. Others will not need this depending on the alignment of their sensor disc and tool turret. Second, for the Macro to work, I have to type M6T0202 to get the turret to index. If I type T02 or M6T02, it triggers for a fraction of a second and does not rotate any noticeable amount. I need to figure out why. Finally, I want the macro to verify that the toolchanger is in the correct position BEFORE exiting. As it now stands, if it think's it's in the correct position (triggered the correct sequence, but didn't lock) it returns control to Mach and obviously, bad things could happen. I want it to either trigger an error code, or try again. Here is my current version of Max's macro.

cheers,
v

[obsolete toolchange macro removed]
Last edited by vandal968 on Mon 12 Mar , 2012 18:46 pm, edited 3 times in total.

vandal968
Posts: 20
Joined: Wed 08 Dec , 2010 11:21 am
Hardware/Software: EasiMill 3; Orac

Re: I need help with an 8 station Orac Tool Turret

Post by vandal968 » Mon 27 Feb , 2012 19:53 pm

Ok, the line:

'Code "G4 P4.0" 'Wait for the tool to rotate past the sensor

appears to be crap. The correct way to call for a delay in VBscript is:

sleep(xx)

Where xx is the delay in milliseconds. I have the script running correctly on my turret with a 700ms delay after the sensor trips. I'm going to make some other changes to guarantee that he turret is locked in the correct position before relinquishing control. I still need to know why the toolchange command needs to be in the form M6T0606. Please speak up if you know how to fix this. I'll post an improved macro in a day or two.

cheers,
v

angel-tech
CNC Guru
CNC Guru
Posts: 525
Joined: Tue 14 Nov , 2006 12:12 pm
Hardware/Software: .....
4 Quatros
3 Oracs
2 Easiturn atc
12 station lathe atc
Mach 3
Location: Quatroland

Re: I need help with an 8 station Orac Tool Turret

Post by angel-tech » Mon 27 Feb , 2012 20:07 pm

LOL, i missed the ', i think mach turn needs the tool offset added to the tool number.

vandal968
Posts: 20
Joined: Wed 08 Dec , 2010 11:21 am
Hardware/Software: EasiMill 3; Orac

Re: I need help with an 8 station Orac Tool Turret

Post by vandal968 » Mon 27 Feb , 2012 20:38 pm

angel-tech wrote:i think mach turn needs the tool offset added to the tool number.
Is this the reason for the repeating tool number? IE: M06T0303 ?

cheers,
v

angel-tech
CNC Guru
CNC Guru
Posts: 525
Joined: Tue 14 Nov , 2006 12:12 pm
Hardware/Software: .....
4 Quatros
3 Oracs
2 Easiturn atc
12 station lathe atc
Mach 3
Location: Quatroland

Re: I need help with an 8 station Orac Tool Turret

Post by angel-tech » Mon 27 Feb , 2012 23:57 pm

yes the to3 is the tool number and the second 03 is the offset number

User avatar
Lone_Ranger
CNC Expert
CNC Expert
Posts: 220
Joined: Mon 01 Oct , 2007 15:23 pm
Contact:

Re: I need help with an 8 station Orac Tool Turret

Post by Lone_Ranger » Tue 28 Feb , 2012 1:14 am

vandal968 wrote:
angel-tech wrote:i think mach turn needs the tool offset added to the tool number.
Is this the reason for the repeating tool number? IE: M06T0303 ?

cheers,
v

In addition to "angel-tech" some machines will also have an extra 03 for the TNR (Tool Nose Radius) settings, pretty standard on all the older Fanuc controls I`ve used and Mach3 runs pretty close to Fanuc ways :-) :-)

The offset can often be any number, doesn`t have to be the same as the tool number, for example a turret with say a 6mm drill in position 5 can have the T0505 for say drilling the first end of the job, the other end may need a 10mm drill but if you didn`t have any more spaces for a different drill you could easily call up a different preset drill length for the 10mm that you had used on a previous job that was on Offset 12 you could then use the same number 5 position and just use T0512 and there would be no need to do another "touch-off" to set the new tool length :-) :-)

I tend to try and have as many tools as possible preset so I can use the system above.

Regards
Rob

vandal968
Posts: 20
Joined: Wed 08 Dec , 2010 11:21 am
Hardware/Software: EasiMill 3; Orac

Re: I need help with an 8 station Orac Tool Turret

Post by vandal968 » Tue 28 Feb , 2012 3:35 am

Thanks for the info about the M06 syntax, I didn't know that.

Ok, Ive got this thing running perfectly. I've added a delay so that the changer runs on for 700ms after it finds the correct position. This allows the ratchet to index. Mine works fine with a delay down to around 500ms, but 700 gives me a little margin. As I was fine-tuning this number, I really didn't like the fact that Mach didn't realize that it was on the wrong tool if the machine hadn't gone far-enough for the ratchet to index. I built-in a double check to account for this. After the change is complete, the machine waits 2000ms (2 secs) then double-checks the changer logic. If the changer is where it should be, it exits. If the changer has under-shot the correct tool (due to not hitting the ratchet and subsequently reversing to the previous tool) it then gives an error message and exits from the program. It seems to work well. If anyone needs to increase the overshoot delay beyond 700ms, I would increase the 2000ms double-check delay by the same amount. IE: if you go up to a 1000ms over-shoot, I would increase the double-check delay to 2300ms, etc. I also removed a few lines of code that were unnecessary. I hope this helps someone. A big Thank You to Max Porter for providing the code that this has evolved from.

cheers,
c 8)

'Denford Orac Turret Macro, Corey Renner v4
Tool = GetSelectedTool()
OldTool = GetCurrentTool()
NewTool = Tool
MaxToolNum = 8 'Max number of tools for the changer

While NewTool > MaxToolNum
NewTool = Question ("Enter New Tool Number up to " & MaxToolNum)
Wend

Call StartTool

While SelectedTool <> NewTool
Call CheckPins
sleep(20)
Wend

sleep(700) 'delay in ms to over-run selected tool position
SelectedTool = NewTool

Call StopTool

sleep(2000) 'delay to allow turret to lock into position
Call CheckPins
If SelectedTool <> NewTool Then 'verify that correct tool has locked in-place. Beep, announce and stop program if not
Beep
MsgBox ("Toolchange has FAILED!!! Try adjusting the over-run delay")
code "M00"
End If

SetCurrentTool(NewTool )

'//// Subroutines ////

Sub StartTool
ActivateSignal(Output3)
End Sub

Sub CheckPins
If Not IsActive(Input1) And Not IsActive(Input2) And IsActive(Input3) Then
SelectedTool = 1
End If
If IsActive(Input1) And Not IsActive(Input2) And IsActive(Input3) Then
SelectedTool = 2
End If
If IsActive(Input1) And IsActive(Input2) And IsActive(Input3) Then
SelectedTool = 3
End If
If Not IsActive(Input1) And IsActive(Input2) And IsActive(Input3) Then
SelectedTool = 4
End If
If Not IsActive(Input1) And IsActive(Input2) And Not IsActive(Input3) Then
SelectedTool = 5
End If
If IsActive(Input1) And IsActive(Input2) And Not IsActive(Input3) Then
SelectedTool = 6
End If
If IsActive(Input1) And Not IsActive(Input2) And Not IsActive(Input3) Then
SelectedTool = 7
End If
If Not IsActive(Input1) And Not IsActive(Input2) And Not IsActive(Input3) Then
SelectedTool = 8
End If
End Sub

Sub Stoptool
DeActivateSignal(Output3)
End Sub

User avatar
Denford Admin
Site Admin
Posts: 3632
Joined: Fri 10 Feb , 2006 12:40 pm
Hardware/Software: Go to User Control Panel > Profile
Enter as much information about your CNC hardware and software as you can - it makes it easier for everyone to know what you're talking about then.
Location: Sunny Brighouse
Contact:

Re: Denford Orac Turret working on Mach 3 macro

Post by Denford Admin » Tue 28 Feb , 2012 10:11 am

I've changed the title and made this sticky to make it easier to find for others.

maxporter
Posts: 10
Joined: Thu 06 Mar , 2008 4:05 am
Location: Sunny California

Re: Denford Orac Turret working on Mach 3 macro

Post by maxporter » Sun 09 Mar , 2014 3:31 am

Hi All,
I have not been on this forum in a long time. Glad to see how far the toolchange macro has developed. Mine has always worked with the original macro, but I like the feedback added to ensure the toolchange actually happened. I will incorporate it in mine. The logics won't work for me because, as I said, I made a lot of my own electronics.
Max Porter

gabrygtt
Posts: 5
Joined: Wed 30 Sep , 2015 13:31 pm
Hardware/Software: Denford orac

Re: Denford Orac Turret working on Mach 3 macro

Post by gabrygtt » Wed 30 Sep , 2015 13:51 pm

Hy guys, i'm Gabriele from italy, i'm a new member..
Last year i bought a denford orac and immediatly i replaced the old electronic with RTA driver and USB CNC MK2 controller..
Now i want re-start the rotary toolpost but i don't understand which component i must use for work in manually mode..
I read the previous post.. i've understand that: when the turret rotates 24 Volts DC is applied, when it reaches the requested position the polarity is then reversed & dropped to 12 Volts..
Whic components i needs for make this in manually mode? my controller and his software don't support a macro... therefore i would like restore the original manual mode with press the button for rotate the turret.. Thanks.. :D :D
(Sorry for my english.. :wink: )

maxporter
Posts: 10
Joined: Thu 06 Mar , 2008 4:05 am
Location: Sunny California

Re: Denford Orac Turret working on Mach 3 macro

Post by maxporter » Thu 01 Oct , 2015 1:51 am

Hi Gabriele,
If I understand you correctly, you just want to be able to index the turret manually to the next position with a push button. If this is what you want, it is actually simple and will not require the use of the optical sensors, gray scale code, or macro. You will need a DPDT (dual pole dual terminal) momentary switch rated for at least 24VDC. you will also need a 24vdc and a 12vdc power supply. The switch has six terminals, 2 terminals are the common (usually the center 2) 2 terminals are normally closed, and 2 terminals are normally open. The normally close terminals have continuity with the corresponding common terminals when the switch is not activated. This is where you connect the 12vdc power supply with the polarity to reverse the motor. Connect the motor leads to the common terminals. Connect the 24vdc power supply to the normally open terminals (these terminals do not have continuity with the commons unless the switch is activated. I would put an on-off switch on the power supplies so that it can be turned of when not in use. To use it in this manner you would activate the switch and hold it until the turret rotated slightly past the tool station you desire then release the switch. The turret will rotate back against the detent and hold that position. You must either turn off the power supplies or unplug them when not in use because the 12vdc is constantly supplied to the motor when the switch is released. I hope this helps,
Max Porter

gabrygtt
Posts: 5
Joined: Wed 30 Sep , 2015 13:31 pm
Hardware/Software: Denford orac

Re: Denford Orac Turret working on Mach 3 macro

Post by gabrygtt » Thu 01 Oct , 2015 8:52 am

Hi Max, Thanks a lot for the help!! :D :D
Ok, i understand, but where i connect the switch for made a rotation of the turret? at the DPDT relay or before?
The motor don't burn if the 12V is applied permanently when the lathe work?
In future (when my controller support macro) i want to command with pc.. i need an optosensor and a ModIO? Thanks!! :D

maxporter
Posts: 10
Joined: Thu 06 Mar , 2008 4:05 am
Location: Sunny California

Re: Denford Orac Turret working on Mach 3 macro

Post by maxporter » Fri 02 Oct , 2015 3:59 am

Gabriele,
To use the turret manually a relay is not necessary, a simple DPDT momentary switch will work. Since you plan to control the turret from your cnc controller in the future, you can use a DPDT relay now. To keep it simple to explain, this would require another DC power supply. Whether you use the switch or the relay, the 2 wires coming from the small dc motor on the turret are connected to the common terminals on the switch or relay. You will not need modio later for cnc control of the turret. The turret should already have the opto sensors and "encoder' discs inside of it. The motor was designed to stay on at 12vdc during operation and though it will get somewhat hot, it should not burn up. When you are actually ready to wire up the sensors, ask and I will try to explain the process. For now, to operate the turret manually, the wiring would be basically the same for the DPDT relay or the DPDT momentary switch. The relay will have 8 terminals instead of the six terminals the switch has. The extra 2 terminals are signal and signal ground. These terminals would normally connect to the digital controller (pc parallel port, opto-isolated breakout board, etc.) There are many relays available with different signal voltage requirements. It depends on a number of things (your breakout board, your PC, and your cnc controller software: Mach3, EMC, Flashcut TurboCNC, AHHA, ETC.) what signal voltage would be best. So let's assume you will be using standard TTL signals such as a PC parallel port outputs. You will need a DPDT relay that takes a 3.5vdc-5vdc signal voltage to activate. You wire the relay the same as the DPDT momentary switch I described previously; the 2 wires coming from the turret motor connect to the 2 common terminals on the relay, the 12vdc power supply's positive and negative wires connect to the normally closed terminals on the relay with the polarity reversed to reverse the turret, and the 24vdc power supply's positive and negative wires connect to the 2 normally open terminals on the relay with polarity to advance the turret forward. Now is when the relay differs from the switch, you will now need to apply 5vdc to the signal terminals on the relay for the 24vdc power to rotate the turret. When the 5vdc is removed from the signal terminals, the 12vdc will reverse the turret against the detent. The 12vdc will be applied to the motor whenever the 5vdc is not applied to the signal terminals. For now, the DPDT momentary switch I described before is much simpler and does not require any additional switches to operate the turret. As I said before, I would add a simple on-off switch to the power supplies for when the lathe is not in use.
I hope this answers your questions,
Max Porter

gabrygtt
Posts: 5
Joined: Wed 30 Sep , 2015 13:31 pm
Hardware/Software: Denford orac

Re: Denford Orac Turret working on Mach 3 macro

Post by gabrygtt » Fri 02 Oct , 2015 16:32 pm

Ok Max, all ok! Thank you for all your assistance !!
:D :D :D :D

andyh
Posts: 5
Joined: Wed 04 Oct , 2017 15:09 pm

Re: Denford Orac Turret working on Mach 3 macro

Post by andyh » Wed 04 Oct , 2017 17:03 pm

I have tried using the macro last night. And it did work but i had a few issues. I will do some more investigation but wondered if anyone had some thoughts. I always got the error adjust overrun delay. It would select a tool but this didn't match the number i selected. If i was on tool 5 and selected the next consecutive number ie 6 it would move a fraction then return back on to tool 5. Ill do some simple checks when i get chance.

but one of my thoughts was should the 'if statement' containing the active inputs to select a tool be looped? will it read through and if these are not met just cancel and fall back on the nearest tool? should this block of statements be looped until one is met?

vandal968
Posts: 20
Joined: Wed 08 Dec , 2010 11:21 am
Hardware/Software: EasiMill 3; Orac

Re: Denford Orac Turret working on Mach 3 macro

Post by vandal968 » Wed 04 Oct , 2017 17:27 pm

Andy, start by confirming that each tool position matches the logic in the tool table. Manually power the turret to each position in-turn and write down the Hi or Lo state of each of the three data lines.
It appears that Denford may have used two different encoder wheels (the logic table that I measured from my machine did not match the logic table on the factory drawings). The other reason that you want to do this, is that it will allow you to confirm that your encoder wheel/optics are clean and registering properly. On mine, I had to gently wipe the encoder wheel and optical sensors clean as dust was interfering with proper operation. One of my three lines was always reading Hi or Lo (forget which, it's been a while), so in 4 of the 8 positions it was reporting its position incorrectly.

cheers,
c
Last edited by vandal968 on Wed 04 Oct , 2017 17:33 pm, edited 1 time in total.

vandal968
Posts: 20
Joined: Wed 08 Dec , 2010 11:21 am
Hardware/Software: EasiMill 3; Orac

Re: Denford Orac Turret working on Mach 3 macro

Post by vandal968 » Wed 04 Oct , 2017 17:31 pm

Also, for anyone looking to convert their Orac and turret... I originally got my machine and turret working under Mach3, in the last couple of weeks I've swapped it over to Centroid Acorn, everything still works and Centroid seems to be a far more capable system (supports constant-speed turning, etc.)

cheers,
c

Post Reply