Home › Forums › TinyG › TinyG Feature Requests › Coolant Output, Spindle Output Negation Commands for Relay
- This topic has 7 replies, 4 voices, and was last updated 11 years, 3 months ago by InPhase.
-
AuthorPosts
-
September 21, 2013 at 2:51 am #4555nexeaMember
I have recently attempted to build a new CNC machine, using TinyG and this 12v 2-Channel relay driver off eBay:
The schematic of this device is located here:
I have wired it up in the following manner:
Vcc = 3.3v
Vjd-cc = 12vIN1 = Spindle OUT
IN2 = Coolant OUT
GND = GND(NO jumper between Vcc and Vjd-cc)
When I have hooked it up, the Spindle and Coolant seem to be ON when they should be OFF. They are also OFF when they should be ON.
For example, M7 is supposed to turn the coolant off, however, the relay turns ON.
M3 turns the relay OFF, and M9 turns the relay ON. Exactly the opposite of what I need.
– My understanding of the problem –
When you issue a coolant ON (M7) command or a spindle ON (M3) command, it raises the Coolant out to high 3.3v and the Spindle out to high 3.3v respectively.
Unfortunately, in the schematic of the relay above, it seems the relay works differently than what is expected to happen.
Turning M7 on turns Coolant out to high 3.3v. In the schematic, Vcc = 3.3v and IN1 == 3.3v, so the voltage difference is 0. No current flows. Therefore, it registers a ON command as OFF.
When you issue a M9 command to turn Coolant off, it turns the Coolant out to low 0v. To ground. In the schematic, Vcc = 3.3 and IN1 = 0 at that point. So current flows. That current flow is picked up on by the optocoupler and turns the circuit ON. Exactly the opposite of what is desired.
– My Proposal –
I submit to you the following request:
Add two additional commands to configure this behavior. One, to negate Coolant OUT, and the other to negate Spindle OUT.
In the same syntax as the motor polarity, a command of something like $con=0 and $con=1 for Coolant Output Negation and, say, a command of something like $son=0 and $son=1 for Spindle Output Negation.
That way it would be up to the user to define.. so that a user can use this relay with no additional TTL negation hardware.
Thank you for your consideration.
– Nexea
September 21, 2013 at 2:53 am #4556nexeaMemberEDIT: Corrected above text.
September 23, 2013 at 7:50 pm #4573mcgyvrMemberYou just connected your loads to the wrong set of contacts on the relays..
If using C and NO then switch to C and NC..
If using C and NC then switch to C and NO..
Thats why form C relays are nice..
You hold all the power to invert the logic.. no software fix needed..- This reply was modified 11 years, 3 months ago by mcgyvr.
September 23, 2013 at 9:04 pm #4576aldenMemberThanks for the suggestion. This is a good idea to make the output sense programmable. Let me work out the best way to do this with the current structures and get it into the builds. No promises on timing, but it should be pretty simple to do.
September 23, 2013 at 10:14 pm #4586nexeaMembermcgyvr:
I’m probably missing something.. can you explain that to me again please?
The relay I have is the one above.. I am not sure I can do that given the schematic of the relay that I have.
How would I wire it up, besides the way that I specified up there?
September 23, 2013 at 10:39 pm #4589InPhaseMemberOn the high voltage side of the relay, you need to change which contacts you have connected. There is a common (2) and an NO (1) and NC (3). When the relay is off, 2 and 3 are connected. When the relay is energized, 1 and 2 are connected.
The fix is a matter of swapping which relay contacts your tools are connected to.
September 23, 2013 at 10:56 pm #4590nexeaMembermcgyvr:
Are you saying put the spindle high voltage connections of the relay on Normally Closed instead of Normally Open?
I tried that, however.. the obvious problem is that everything turns on by default. When the TinyG controller is off that means BOTH the coolant and the spindle turn on.. which is.. undesirable.
September 24, 2013 at 8:10 am #4595InPhaseMemberI was thinking about this before I went to sleep last night and have a fix for you. The TinyG output goes HIGH when it is ON. Your relay driver schematic is assuming an ACTIVE LO from the board, which is opposite.
The solution is to put Vcc on the board output and put IN1 to ground. And of course make sure the high voltage connections are correct.
-
AuthorPosts
- You must be logged in to reply to this topic.