Hello Guest it is April 18, 2024, 07:38:28 AM

Author Topic: How to write macro to control two spindle motor ?  (Read 5046 times)

0 Members and 1 Guest are viewing this topic.

How to write macro to control two spindle motor ?
« on: August 11, 2011, 09:18:02 AM »
Hello,
I need the help. Right now I have two spindle on Z- axis. If I fill MDI on mach3 screen with M03,two spindles will rotate simultaneously.
I  want to control two spindles independently. I don't know how to write macro.
I mean if I write M101,the A spindle will rotate but the B spindle will not.
           If I write M102,the B spindle will rotate but the A spindle will not.

Pls advise me how to write VB macro

Mongkol

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: How to write macro to control two spindle motor ?
« Reply #1 on: August 11, 2011, 10:38:13 AM »
Looks like you have every thing you need now.  M3 turns on both, M101 turns on A,  M102 turns on B. What other possible combos are there??

Just a thought(;-) TP
Re: How to write macro to control two spindle motor ?
« Reply #2 on: August 11, 2011, 10:46:00 AM »
TP,
Thanks for the reply. I don't know how to write VB macro on M101 and M102. Pls advise.

Mongkol

Offline stirling

*
  • *
  •  2,188 2,188
  • UK
    • View Profile
    • www.razordance.co.uk
Re: How to write macro to control two spindle motor ?
« Reply #3 on: August 12, 2011, 05:31:58 AM »
Hello,
I need the help. Right now I have two spindle on Z- axis. If I fill MDI on mach3 screen with M03,two spindles will rotate simultaneously.
I'll assume you have BOTH spindles activated/connected via OUTPUT1.

First connect your second spindle to OUTPUT6 (for example) instead.

Now M03 will only activate spindle 1.

Now create another macro (say) M102 with this line...

activateSignal(OUTPUT6).

Then ADD the following to M05

deactivateSignal(OUTPUT6)

Now M03 will turn on spindle 1 and M102 will turn on spindle 2 and M05 will turn off whichever one/or both is on.

(remember to setup OUTPUT6 (or whichever) in ports n pins)

Cheers

Ian

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: How to write macro to control two spindle motor ?
« Reply #4 on: August 12, 2011, 11:28:09 AM »
OK I get what you mean now,sorry.  I think Stirling has you covered on this one.

(;-) TP