Spindle Automation Issue

Hi All,

So I’m trying to use a relay to start/stop the router. I have the the spindle automation selected to on in the advance settings and I have the relay currently wired using jumpers awaiting my 3pin connectors to arrive through the mail. What I’ve noticed is that when the Gcode starts, the M3 code does not send the 5v signal to the relay. When I use the stop button to stop the program, it sends the 5v signal to the relay and does not turn off at all even if I hit the stop again or unplug power from the PCB. The only way I know to disconnect the signal to the relay is to unplug the USB cord the PCB/computer. Is anyone else having this same if not a similar issue? Please see the attached for current relay wiring.

Try This:

Nevermind, It is late, and the more I looked at the schematic I drew up… the more I thought I missed something…
Image removed… I will look at it again in the morning and see if it makes sense for what you are doing.

Sorry

Be careful, it sounds like the wiring from the AUX pin to the relay board might be incorrect.
You should have the pin farthest from the edge of the Maslow board connected to GND on the relay board, and the pin closest to the edge connected to the relay control terminal. The middle wire in the AUX group is 5V, and if that is used instead of GND, the reverse operation you describe would result.
Let us know if this helps :grin:

I believe I have it wired the way your speaking @blurfl. Should I be flipping the wires around? Here is an additional picture showing the terminal labels on the relay. I hooked the 5v input to VCC, GND to GND and signal to IN4.IMG_0766

1 Like

It sounds to me like the Arduino is sending a HIGH signal to stop the router and a LOW to start it. Switch line voltage wiring to the opposite condition (if it is in the “normally closed” position put it in the “normally open” position or vice versa) and see if that solves your issue.

1 Like

Yes you do, that’s good. Keith’s point about using the ‘normally open’ contacts is a good one. That way, the red IN4 LED on the relay board should be on when the Maslow board executes M3, and the relay will close and pass power to the router when the LED is lit, shut it off when not lit (is that M2?)

1 Like

M5 should turn it off

M3 and M4 have the same effect, to turn the router on, as there is no way to control the direction of rotation through GC.

2 Likes

Keith I appreciate your comments. I will have to double check this when I get home. I was pretty sure that I had this on the normally open circuit. Just thinking about this, when the gcode is started and M3 is implemented, shouldn’t the relay light up? When I run the sample dragon.nc file the M3 code does not initiate the relay to connect nor does the LED illuminate. When I hit the red stop button it causes the IN4 LED to light up.

image

Could this potentially mean I have the signal wire and 5v wires backwards? Could this mean there is a maslow card software issue?

I feel that if the voltage wiring is switched, this may cause a negative effect where the router will not turn off if the stop button is pressed or M3 is not initiated.

Perhaps I’m going in circles here.

Could this be an issue with “servo mode” vs “relay mode”…speaking as someone with no experience with either

Hi @bar,

In the advanced settings of GC I switched the spindle automation to on. I’m not sure if there is a logic issue or not. It most likely be an error on my part with wiring. I will try and confirm tonight my findings.

Depending on how the code works, you may need to have it in the normally closed position. If the code sends a HIGH signal for a spindle stop command, then the relay would need to be used in the normally closed position since the HIGH signal is opening the relay.

It is possible, but looking at your images, it doesn’t appear so. I don’t know how the commands are coded into the firmware, but it could be that the Spindle Stop (M5) is coded to be an active high signal while the spindle start (M3 or M4) is coded to be a low signal. From the standpoint of the microcontroller, it doesn’t really make a difference.

@Bar, do you happen to know what the logic state of AUX1 is for the M3/M4 and M5 commands?

That is a valid concern, so I would test it with no bit installed, and while I was close enough to turn it off manually if necessary. That said, if the relay is functioning properly, and you have the signal wires set up properly (which we believe you do), then activating the relay will operate the spindle.

Let us know how it goes.

Is that a configurable option? If I am not mistaken, servo mode will send a pwm signal, which could potentially result in a lower than “HIGH” signal being sent.

Here’s the way I think it works.
The ‘spindle automation’ setting, when turned ‘off’, sends servo-control pulses out AUX1. Servo-control pulses will look to the relay board like voltages between 0 and 1 volts.
When ‘spindle automation’ is turned ‘on’, AUX1 will go to 5V for M3 or M4 and go to 0V for M2, M5, M6 or M30.

that’s that’s what I would have expected, but it could be that 5V is sent for M2, M5, M6, or M30. I haven’t looked at the code, so I can’t answer definitively.

I hooked up a meter to AUX1, 0V is sent for those codes. :+1:

Excellent. Did you verify that M3/M4 sends a 5V signal? Also, what GC and FW is everyone using? I’m on 1.07. I doubt that the code would have changed, but just for completeness.

Are you utilizing this functionality?

My current GC and FW is 1.10

When ‘spindle automation’ is turned ‘on’, yes.
When ‘spindle automation’ is off, the logic and outputs are designed to drive a servo motor to mechanically flip a toggle switch on and off.
The code hasn’t changed in months.

2 Likes

Perfect explanation. Thanks @blurfl

1 Like

Ok guys and gals,

This is what I observed and experienced last night. Before I did anything I updated the FW and GC to version 1.11. I double checked the normally open / normally closed circuits on the relay. My initial voltage wiring setup was on normally open. When I activated the gcode and the M3 command is sent, the relay does not receive a signal from the Maslow PCB. When the stop button is pressed in GC, the relay receives a signal, energizes the contacts and completes the circuit which illuminates the LED on the relay. There was no other way to de-energize the relay other than to unplug the USB cable from the laptop or PCB.

With that said, I tried changing the voltage wiring setup on the relay terminals where instead of using the normally open circuit terminals, I switched it to the normally closed terminals. I restarted the laptop, opened up the dragon.nc file in the gcodefortesting folder and everything worked flawlessly. I could start and stop the router using the GUI of GC. It was amazing. So I proceeded to end my night by leaving the laptop power on and letting it go to sleep as it normally does. The relay was energized in the closed position when I walked away from the machine, meaning the router was off. Than later in the evening around 12:00am, my wife and I were abruptly awakened by this roaring sound from the basement, this is where my maslow setup is located, to find that the laptop either restarted or turned off causing the relay to de-energized putting the relay in the normally closed state causing the router to turn on.

I do not believe the design intent of the relay is to operate this router on a relay in the normally closed condition. I understand that the logic code for the maslow PCB has not changed in months but is there the possibility that the signal is backwards? Or not sending the correct signal. I’m only asking as I’m not an expert here.

Here is a link to the relay that I’m using.

Could it be the wrong type of relay for this application?

One thing I haven’t tried yet is trying the other available relays. I expect the same result between the voltage terminals over the each relay.

Help here, as always, is greatly appreciated.

TMW

To be clear, when you say:

do you mean that when you put a volt meter on on the signal line you are getting 0V (or close enough)? And when you hit Stop the voltage is 5V? (if you could also test M5, that would be great. the Stop button is really meant for immediately stopping in the middle of a gcode program)

Yeah, that’s a bad thing. On that note, though, removing power from the spindle rather than relying on a software control when the machine is unattended is not ever going to be safe, even if the “fail” state is to the off position since there is always the chance that a transient signal might cause an unintended startup. Personally, my plan is engage an e-stop that shuts off both the motors and the router at the end of a session (and possibly a separate switch just for the router, though turning the switch on the router is probably easier).

That said, I am also curious about why your arduino is sending 0V when you send the M3 command. Have you also tried using the M5 command to stop the router (or otherwise put the relay output in the off position). From what you’ve reported, it sounds like the relay is working as it should, but your signal from the arduino is backwards. This is contradicted by what @blurfl has reported. The discrepancy is concerning. To prevent what you ran into overnight having it work as @blurfl indicates is what we want. From looking at the relay you specified, it looks like it is not the relay, which leaves my initial question.

So, good news that you are able to use the functionality, but bad news that the un-powered arduino causes a loss of control of the router.