Coolant Output, Spindle Output Negation Commands for Relay

Home Forums TinyG TinyG Feature Requests Coolant Output, Spindle Output Negation Commands for Relay

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #4555
    nexea
    Member

    I have recently attempted to build a new CNC machine, using TinyG and this 12v 2-Channel relay driver off eBay:

    View post on imgur.com

    The schematic of this device is located here:

    View post on imgur.com

    I have wired it up in the following manner:
    Vcc = 3.3v
    Vjd-cc = 12v

    IN1 = 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

    #4556
    nexea
    Member

    EDIT: Corrected above text.

    #4573
    mcgyvr
    Member

    You 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 10 years, 12 months ago by mcgyvr.
    #4576
    alden
    Member

    Thanks 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.

    #4586
    nexea
    Member

    mcgyvr:

    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?

    #4589
    InPhase
    Member

    On 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.

    #4590
    nexea
    Member

    mcgyvr:

    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.

    #4595
    InPhase
    Member

    I 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.

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.