Hello Guest it is March 28, 2024, 06:33:18 PM

Author Topic: Mach3 with a DMC-2162 (Aero)  (Read 26466 times)

0 Members and 1 Guest are viewing this topic.

Re: Mach3 with a DMC-2162 (Aero)
« Reply #10 on: February 09, 2011, 02:05:42 AM »
everything is in mach already to run a spindle!
just wire it to motor command output.

use the spindle speed button on screen to operate or m3 m5 commands in gcode. set speed on screen or through g code

you only need macros if you need to physically automatically change gears etc or run from external buttons
i use the analogue inputs on galil to give me load, max load readings on the screen too (requires a small macro) something to do when the machine is up and running ok.
if its not broken yet, fit more gadgets!
Re: Mach3 with a DMC-2162 (Aero)
« Reply #11 on: February 09, 2011, 05:15:52 PM »
OK I still haven't nutted up for the spindle  :P... But I have almost all my inputs mapped, I do have all my outputs mapped!! I have a external tool unclamp button. It's on a daughter card so I have to assign it to an LED. I want it to trigger the tool unclamp output. How can I go about doing this? I was going to use config>system hotkeys, but those are only for OEM triggers.

Any help would be great.


Thanks,

Aero
Re: Mach3 with a DMC-2162 (Aero)
« Reply #12 on: February 09, 2011, 07:47:49 PM »
WooT I figured it out!!! I wasn't sure if "Brains" had to be called on like macros.... I guess not :)


Aero
Re: Mach3 with a DMC-2162 (Aero)
« Reply #13 on: February 09, 2011, 09:39:43 PM »
I'm working on my tool changer macro, I need to find out what the command is to stop the macro and error the controller. If I have T5 in the spindle and I call out for a T0, I want the macro to message that T0 is invalid and to stop the macro and maybe E-stop the machine.

This is what I have so far:
Sub Main ()
OldTool = GetOEMDRO (1200)
NewTool = tool
If NewTool = OldTool Then
   Exit Sub
End If
If NewTool = 0 Then
   MsgBox("No Tool Number Given")
   ActivateSignal(EStop)
   Exit Sub
End If

If NewTool < 0 Then
   MsgBox("Invalid Tool Number")
   ActivateSignal(EStop)
   Exit Sub

If NewTool<0 Then
   NewTool = (24 + NewTool)
End If
If NewTool>0 Then If
   NewTool <=12


I have a 24 tool, tool changer and I'm setting it up for fastest route to next called out tool. I snagged that OEMDRO thing from another TC macro... not sure if I will use it or not... just a filler :P

The line I'm asking about is "   ActivateSignal(EStop)" will this work? Or is there another way to do it?

Thanks,

Aero
Re: Mach3 with a DMC-2162 (Aero)
« Reply #14 on: February 10, 2011, 02:39:51 PM »
Dobutton(21)

This is the code for pushing the EStop


Aero
Re: Mach3 with a DMC-2162 (Aero)
« Reply #15 on: February 14, 2011, 08:53:43 AM »
use something like this

maxtool=24
if tool<1 or tool>maxtool then
message"tool number not available"
end
end if

also grab tool diameter and height from tool table and check these are not 0.
if its not broken yet, fit more gadgets!
Re: Mach3 with a DMC-2162 (Aero)
« Reply #16 on: February 14, 2011, 12:17:40 PM »
This is what I came up with for my tool changer. Works nice :) My machine has a 24 tool magazine. The Z-axis goes home and the tool mag. moves under the spindle. The tool unclamps and the mag. does down. The mag then moves CW or CCW, depending on shortest route to next tool. The mag then moves back up , the tool clamps, and the mag moves to it's back position.


Some of the inputs and outputs:

OUTPUT2 = Tool unclamp
OUTPUT3 = Magazine Forward (Moves mag. under spindle)
OUTPUT4 = Mag. Down
OUTPUT5 = Mag CW
OUTPUT6 = Mag CCW
OUTPUT10 = Orientates the spindle for a tool change

OEMTRIG8 = Mag. Back switch - Input
OEMTRIG9 = Mag. Forward switch - Input
OEMTRIG10 = Mag Up switch - Input
OEMTRIG11 = Mag Down switch - Input
OEMTRIG12 = Mag Position counter switch - Input
OEMTRIG14 = Tool Clamped switch - Input
OEMTRIG15 = Tool Unclamp switch - Input

Re: Mach3 with a DMC-2162 (Aero)
« Reply #17 on: February 14, 2011, 12:40:38 PM »
just had a look at your changer macro... a bit long winded but heh if it works dont fix it.

one thing wortyh adding if your in a waiting loop is a get out clause.
start the loop with

if isestop() then
end
end if

that way if your switch never closes your macro can be stopped instantly by pressing estop rather than constantly looping and freezing mach up.
also worth adding sleep(10) after commands to ensure they get used and not overlooked-gives mach more processing time while in macro too.

after any motion command use

while ismoving()
sleep(10)
wend
to ensure they complete before anything else happens

hope those few pointers help

i just wrote macro for this
http://www.youtube.com/watch?v=oHnvQ1TuFI0
if its not broken yet, fit more gadgets!
Re: Mach3 with a DMC-2162 (Aero)
« Reply #18 on: February 14, 2011, 02:11:49 PM »
OK, so I have all my A-axis working good, and I have my tool changer working nicely. Now I'm messing with the spindle. I have a Yaskawa Varispeed spindle drive. My spindle has an encoder. I set the plugin up so that my spindle is on "E". And I have "Spindle has encoder" checked. The counts I have set to 4096 and "accel Revs/Sec set to 0. The motor type for "E" is set to servo. Under config>Ports and Pins>Motor outputs I have the spindle enabled and nothing else checked or changed (0's across the board). Under Spindle Setup I have "Relay Control" unchecked (I have a relay I have to turn on for Spindle Forward, OUTPUT#1). I put Output 1 in both M3 and M4, I only really need it on for forward but Mach wont let me choose 0. I have, under "Motor Control", "Use Spindle Motor Output" and "Step/Dir Motor" checked. Under "Special Functions" I don't have anything checked.

I can get the spindle to start but it goes to full speed, even if I put M3S1. I'm not sure what I'm doing wrong.


Any help would be great!!

Thanks,

Aero

P.S. It worked good in Camsoft, so I know the Galil card is talking to the Varispeed.
Re: Mach3 with a DMC-2162 (Aero)
« Reply #19 on: February 14, 2011, 02:16:12 PM »
Here is my Galil debug.


Aero