Welcome to Our Community

Some features disabled for guests. Register Today.

TinyG struggling with spindle relay

Discussion in 'General Electronics' started by leversole, Dec 26, 2015.

  1. leversole

    leversole New
    Builder

    Joined:
    Nov 1, 2015
    Messages:
    77
    Likes Received:
    14
    I have the TinyG controller and one of the chinese solid state relays to trun on/off the spindle...with this setup, sometimes (most times actually!) the router "hunts" around for speed, like the power is mometarily being switched off/on...thought it might have something to do with the voltage and its effect coming thru the relay having on the variable speed router...today I did some testing and at 12v from an old ATX power supply, and 24v from my main supply, the relay powers the router fine with no drops/speed variation...checking the voltage coming out of the TinyG, I am getting 3.09v, whcih I believe is at the very bottom end of switching the relay on...is there anything I can do? Has anyone else ran one othe import relays to start/stop the router/spindle with the tinyG?

    Thanks
     
  2. Robert Bailey

    Robert Bailey Well-Known
    Builder

    Joined:
    Mar 23, 2015
    Messages:
    117
    Likes Received:
    71
    I looked at that also, a standard SSR is usually 5-24vdc to switch on, I found some on ebay that said 3vdc DC 3-32V AC 24-80V 40A SSR-40DA Solid State Relay Module for Arduino

    I took them to work and had my engineer friend check them and they switch on below 3vdc, have to remember the tinyg is based on adrunio which is 3volts, need more than that and you will have to get a 5vdc supply and a level converter.
     
  3. David the swarfer

    David the swarfer OpenBuilds Team
    Staff Member Moderator Builder Resident Builder

    Joined:
    Aug 6, 2013
    Messages:
    3,238
    Likes Received:
    1,815
    I would put a transistor between the tinyg and the relay. us the 'open collector' type of connection, and 5 volts supply to the transistor. should be plenty of examples on the web...
     
  4. Scott594

    Scott594 New
    Builder

    Joined:
    Jan 4, 2016
    Messages:
    20
    Likes Received:
    3
    Correct on the input voltage issue, but there's more.
    The triacs in the ssr often don't play well with ac/dc brushed motors - like those typical of a router/dremel. Also if your router has it's own speed control, stacking them is a no-no.
     
  5. leversole

    leversole New
    Builder

    Joined:
    Nov 1, 2015
    Messages:
    77
    Likes Received:
    14
    Not sure what you mean by "stacking" them? The router is a variable speed model...does that mean I will shorten its life using a SSR? Are there any work arounds? I like the router and would like to control the on/off...

    Thansk
     
  6. Scott594

    Scott594 New
    Builder

    Joined:
    Jan 4, 2016
    Messages:
    20
    Likes Received:
    3
    By stacking, I mean more than one solid state switching device in series.

    The way most speed controls (and Solid State Relays) work is by switching the power on or off (once at each half cycle). They use a device called a Triac. The nature of a Triac is to switch on once triggered, it latches and remains on until power flow through it ceases. This is accomplished by the incoming AC power crossing zero volts, which occurs twice per cycle.

    When used a a speed control, the dial determines at what voltage the triac turns on. If it's set 1/2 power, the triac fires at 1/2 of the peak voltage and remains on until the voltage once again crosses zero, it then repeats (in the opposite polarity - that's the difference between a Triac and SCR).

    A solid state relay uses a triac as well, but it fires at nearly zero (a few volts in actual practice) and is automatically re-triggered by the incoming control signal (thru an optical isolator) on every cycle.

    The problem occurs with 2 devices in line that shut down upon removal of power. When one shuts down, the other does as well, even if it's still receiving a trigger signal.

    What you have is 2 self latching devices, and the one that shuts down 1st not only shuts down the other, it cannot again be triggered until power is restored (the other device triggers) thus you have a catch 22, with both devices triggering almost at random.

    If you simply bypass the variable speed control on the Router, it will allow the SSR to function normally. Also be aware that some DC (brushed) motors go "open circuit" at some point in their rotation, and can falsely shut down a SSR. Most high quality SSRs have a small capacitor to keep them latched during this period, but a cheapie may not.

    In my opinion, your BEST solution is to use a conventional mechanical relay as your control, then you can leave your speed control intact. The main advantage of SSRs is switching speed and lack of wear. Neither is a concern for a CNC router, you're not switching on and off at an extraordinary rate or frequency. The contacts on a good conventional relay are plenty fast and durable for your application.

    We've used good old fashioned mechanical relays for 100years turning on motors a lot bigger than a router. Just figure on replacing the relay every 20 to 50 years when the contacts wear out.

    Hope it helps, Scott

    PS - I just thought of one more thing you may want to know. If your control board isn't capable of providing enough coil power to close a mechanical relay, (I'm not sure about the 'TinyG' but is doesn't sound very robust, some boards have a transistor, others use just an IC output which is fairly low current) the usual solution is to install a transistor to switch the coil current, but if you're not comfortable with building that, you CAN use your existing SSR to switch a Relay on, thus switching on your router. That way, it won't require any additional electronics, just hook what now goes to your router to a relay with the proper coil voltage.

    To evaluate the situation, see if the TinyG has a spec for relay current/voltage. Then see if you can find a mechanical relay that meets the specs (or lower). You'll want a 1n4000 series diode backwards across the coil to absorb the spike it generates on shutdown, or it may damage the board.

    One last thing, if you want to confirm the interaction issue, just plug an incadescent lamp into the router socket and see if it switches properly. If so, you know for sure it's the speed control causing the problem.

    If you need a hand getting a mechanical relay selected and wired, I'd be happy to help you get it sorted out.
     
    #6 Scott594, Jan 10, 2016
    Last edited: Jan 10, 2016
    Steve Barns likes this.
  7. leversole

    leversole New
    Builder

    Joined:
    Nov 1, 2015
    Messages:
    77
    Likes Received:
    14
    Thanks Scott! Even though I don't know much about electronics, I was able to follow your great explanation! I will look for a mechanical relay (I got a std ice cube relay from work, not sure what voltage to switch it, but I will check tomorrow! If 12v will switch he contacts, I will let the TG switch the SSR, use an ATX power supply to switch the relay...

    Thanks again! Will let you know how it turns out!
     
  8. Scott594

    Scott594 New
    Builder

    Joined:
    Jan 4, 2016
    Messages:
    20
    Likes Received:
    3
    I did some research. You are correct that the Tiny G has a 3.3v logic output, which is ragged edge for stndard 5v logic devices, and I know of no mechanical relay that will work for you.
    I looked up the Tiny G, but couldn't find much on the Spindle out except that the Tiny G has a PWM (Pulse Width Modulation) output for the spindle. Not sure if it's ONLY PWM or if it's an option. The way the PWM works is by switching power on and off rapidly to control the speed. This happens way too fast for a mechanical relay to work.
    If your Gcode calls for anything but 100%, it will go nuts, and you'll have 2 issues fighting you. Make sure you only call 100% or 0% Spindle speed. I'm not sure if you can setup the Tiny G for on/off only or if it's just software selectable. Sometimes there are separate pins for PWM and on/off outputs.
    Either way it's a 3.3v signal, as you pointed out. What I suggest is that you get a Arduino relay board. which contains a relay, opto-isolator and transistor relay driver, all wired up for you. They're available from ebay, or any place that dabbles in the Arduino stuff (probably even Wal-mart at this point). They come in 1, 2, 4, 8 etc relay configurations. 1 will do you.
    You connect a 5v supply (a wall-wart is plenty, the ATX supply is way,way,way overkill here.) The opto isolator keeps the 5v from getting into your Tiny G and damaging anything, and the relay contacts are right there, ready for your router hookup. They cost right around 1 dollar US.
    That done, make sure yo only call for 100% and yo should be running with on/off under software control, and speed on your router.

    5V One 1 Channel Relay Module Board Shield For PIC AVR DSP ARM MCU Arduino
     
    #8 Scott594, Jan 11, 2016
    Last edited: Jan 11, 2016
  9. Scott594

    Scott594 New
    Builder

    Joined:
    Jan 4, 2016
    Messages:
    20
    Likes Received:
    3
    There's a lot of ways to get there, Here's a relay you CAN just hook to the SSR output as it is wired (assuming it is triggering o based on the light test.

    MAGNECRAFT 9AS5A52-120 Enclosed Power Relay, 30A, 120VAC, SPDT

    The Arduino relay board solves both the voltage and triac interaction issues, so it's probably the best solution.
    You can power it with any small 5v supply like a USB adapter

    5V 2A Micro USB Charger Adapter Cable Power Supply for Raspberry Pi B+ B US Plug

    Hope I'm not confusing you with all the options/info.

    Scott

    Just browsing around here (I'm new to Openbuilds) and ran onto this, which you probably have seen, but it's the best spindle switch connection instructions I've seen. Figures it's right here.
    The Spindle info starts @0:50.
    How to Setup & Configure An OX CNC Controlled by a TinyG V8 | OpenBuilds
     
    #9 Scott594, Jan 11, 2016
    Last edited: Jan 11, 2016
  10. leversole

    leversole New
    Builder

    Joined:
    Nov 1, 2015
    Messages:
    77
    Likes Received:
    14
    Thanks Scott...first I will make sure the SSR (from the TinyG signal) will light a light without visible flickering..
    I just drew out the wiring becauwe I was slightly confused, I think I understand...

    The tiny G will switch my current SSR as it is wired, I will run 5v+ thru the SSR output to the shield relay, and the 5v-, then the 120V thru the ouput of the shield relay to the router?!? If I got it, it sounds like a plan....

    Thanks!
     
  11. Scott594

    Scott594 New
    Builder

    Joined:
    Jan 4, 2016
    Messages:
    20
    Likes Received:
    3
    No quite. that's a mix of a couple of the possible ways of doing it.
    The SSR can't switch DC. It will not shut back off (and probably wouldn't trigger on 5v anyway.
    Here's 2 ways fo getting the job done.

    #1 The "Low Voltage" solution:
    Get the Relay shield, and power it with a little 5VDC supply. Connect the tiny G output to the "input" which is designed to use the 3.3v Arduino output signals. Then, at the opposite end of the board, You'll find a Common, NC, and NO terminal strip. Connect the "common" to the AC line thru fusing, and the "NO to the router socket hot.(Narrow Blade on US sockets) Connect the Router Neutral to the router socket directly. (White wire to silver screw, Wide blade)

    #2 The "High Voltage" Solution:
    Verify the stable switching of your SSR arrangement using a table lamp or similar. Get a relay with a 120VAC coil, and contact rating to suit your router. The Magnecraft from Zoro is good. Connect the coil pins to the existing SSR output. Wire the contacts as in #1 for the output.

    If it were me, I'd probably opt for #1. It involves less line voltae handling, and the parts are used according to good design practices. Either will work fine however.

    One thing you might do right off is put a red LED (with a 1 to 2.2k resistor in series) across the Tiny G Spindle output pin and ground. Then you'll have a handy indication what's actually going on. I like indicators on everything, the cost is very low, and they make servicing much easier.
    (Use small red LED, they have the lowest forward voltage, and will work for sure on 3.3v. The resistor limits the current to 3.3ma, enough to light the LED, but it's a small enough current as to be inconsequential to the Tiny G.


    If you PM your Email, or email me, I'll send you a drawing for each. I havn't figured out the photo posting here yet.

    My email is [email protected]. Just make sure you put something in the subject so I know it's you.
     
  12. leversole

    leversole New
    Builder

    Joined:
    Nov 1, 2015
    Messages:
    77
    Likes Received:
    14
    Scott fixed me up with a sketch! I used the "high voltage" option because I found a 120v mechanical relay locally...wired it up and it works great!...now, how long till I start a job with the router switch turned off! o_O

    Here is the drawing if anyone else is interested....
    Spindle Switching011216a.jpg
     
  13. Scott594

    Scott594 New
    Builder

    Joined:
    Jan 4, 2016
    Messages:
    20
    Likes Received:
    3
    Thanks for posting it up, and glad is's running!!

    Scott
     
  14. leversole

    leversole New
    Builder

    Joined:
    Nov 1, 2015
    Messages:
    77
    Likes Received:
    14
    Couldn't have done it without you Scott!

    Thanks!
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice