Hello Guest it is March 28, 2024, 12:18:54 PM

Author Topic: Can Mach3 do CW and CCW in the spindle with just one relay and one output?  (Read 1354 times)

0 Members and 1 Guest are viewing this topic.

Hi!

I've got a micro lathe working normally in Mach3 with it's stock motor, in CW and CCW, with two relays (to invert the wirings of the motor) and two outputs in Mach3 to do M3 and M5.

I'm buying a new brushless spindle motor and controller to adapt in my lathe.

The controller has one input (DIRECTION) that when connected to it's own GND turns the spindle CW and when let it floating (or in 5V) does CCW.

And another input (ENABLE INPUT) that when connected to GND turn the spindle on, and when not, turns off

So, I just need one relay to do CW or CCW with this controller.

Is there a way on Mach3 to set both CW and CCW to only one OUTPUT (instead of the two outputs required in the Spindle Configuration Screen), and only one relay, and then when the OUTPUT is LOW, the relay would be off, the spindle would be in CW and when in HIGH, the relay would be on, and the spindle would be in CCW.

If not, how can I solve this?

Thanks!

Offline ZASto

*
  •  423 423
    • View Profile
You will need 2 outputs from your BOB to control 2 relays.
First relay for CW/CCW and second for Start/Stop spindle.
Second, you can edit macros in your Mach3/macros/'your profile' folder named m3.m1s and m4 m1s
For example:

Code: [Select]
m3.m1s

ActivateSignal(OUTPUTx) ' switches ON direction control relay
DoSpinCW()                   ' switches enable relay

Code: [Select]
m4.m1s

DeactivateSignal(OUTPUTx) ' switches OFF direction control relay
DoSpinCW()                       ' switches enable relay


OUTPUTx is an output that you should define/enable in Pots & Pins

Attached you can see that CW and CCW can share same pin.
Make no mistake between my personality and my attitude.
My personality is who I am.
My attitude depends on who you are.
You will need 2 outputs from your BOB to control 2 relays.
First relay for CW/CCW and second for Start/Stop spindle.
Second, you can edit macros in your Mach3/macros/'your profile' folder named m3.m1s and m4 m1s
For example:

Code: [Select]
m3.m1s

ActivateSignal(OUTPUTx) ' switches ON direction control relay
DoSpinCW()                   ' switches enable relay

Code: [Select]
m4.m1s

DeactivateSignal(OUTPUTx) ' switches OFF direction control relay
DoSpinCW()                       ' switches enable relay


OUTPUTx is an output that you should define/enable in Pots & Pins

Attached you can see that CW and CCW can share same pin.

Thanks! That pretty much solves it all!

Only one doubt: How do I assign the output pin for the enable relay to the DoSpinCW() function? I mean, how does this DoSpinCW() function knows which pin to send a signal? Is it the Spindle Output Pin in the Output port configuration?

Thanks a lot for your help!

Rodrigo

Offline ZASto

*
  •  423 423
    • View Profile
Well, DoSpinCW/CCW will activate Output1, according to image that I attached. -> Enable signal
OUTPUTx (x is an output that is free on your BOB) -> Spinning direction signal.

HTH
Make no mistake between my personality and my attitude.
My personality is who I am.
My attitude depends on who you are.
Hi! Just today I managed to upgrade my motor. I’d like thank you for your help. It worked perfectly. I changed the m4 and m3 macros as you said and everything is working!

Thanks!