1. Got a question or need help troubleshooting? Post to the troubleshooting forum or Search the forums!

Power timer mod. Power down when print is finished

Discussion in 'Mods and Upgrades' started by tonycstech, Jan 17, 2014.

  1. tonycstech

    tonycstech Active Member

    Joined:
    Dec 16, 2013
    Messages:
    606
    Likes Received:
    196
    I thought i'd share my long time idea about having printer completely go off when print is done.
    Too bad there is no such thing as CODE to make printer go off, power supply will stay on all the time.
    So i ended up buying Stanley 110v timer cheapest i could find was $11 on amazon or ebay.
    I hooked it up the way shown in the pictures and came up with fairly good result.

    I had to drill bigger hole for the reset button to make it easier to press so i can simply set the time off without having to worry about current time being correct, i just set the hrs and minutes printing software estimated + few more minutes and go to work.
    DSC06408.JPG DSC06409.JPG DSC06410.JPG DSC06411.JPG DSC06413.JPG
    I hope this will inspire you to do a better one.
     
  2. Mike Kelly

    Mike Kelly Volunteer

    Joined:
    Mar 11, 2013
    Messages:
    6,967
    Likes Received:
    2,276
    You should add plenty of buffer time. I've had "7 hour" prints take over 10.

    I'm wondering if there's a spare output that we could use to trigger a relay.
     
  3. tonycstech

    tonycstech Active Member

    Joined:
    Dec 16, 2013
    Messages:
    606
    Likes Received:
    196
    Depending on software you use to estimate time.
    For me CURA did great job with 2.5hr estimate. Print ended at about same time.
    What would take to print 7hrs ?
    Can you share this model with me so i could see how fast i would be able to print it win CURA settings i have ?

    Some guy gave me a link on http://www.amazon.com/gp/product/B0...iveASIN=B0094GA9GG&linkCode=as2&tag=poin0a-20
    This could be used on a nozzle to trip the relay after print is done and nozzle is cooled off.
    That is only if there is a spare output for the relay, i wasnt looking for one :(
     
  4. CAMBO3D

    CAMBO3D New Member

    Joined:
    Feb 20, 2013
    Messages:
    642
    Likes Received:
    296
    how long is the timer good for???... Ive had prints take over 14hrs+. at max resolutions.
    the temperature switch would nice add on and expand possibilities.... i was looking at that myself.
     
  5. tonycstech

    tonycstech Active Member

    Joined:
    Dec 16, 2013
    Messages:
    606
    Likes Received:
    196
    You can set timer for max of 23hrs and 59 minutes DOH
    Temp switch killer is easier alternative but the one he provided is 250volt. I dont see any for 110v :(
    I would like to have something like that attached to my nozzle so that when print is over and nozzle cooled off, thermostat would flip the 110v off on the entire printer.
    If thermostat is 110v, then you end up having 110v at your nozzle :)
    There may be another place to take temperature readings such as board yellow fins them selves. I am not 100% sure they get hotter only during pint. If the do, all u gotta do is to measure their temp when nothing is printing and temp when something does print. That way u would know what temp rating u want for termostat in order for it to flip at the temperature u need.
    I would assume room temperature would be safe bet, but my question is: If my board at room temperature, how does thermostat turns on in the first place ? Do i need to warm it up or something ?
    I guess you could have a manual switch installed at the front somewhere. Switch would swap power going directly from the outlet into thermostat first and then to printer, so that when nozzle cools down, thermostat would trip and turn off the main power.
     
  6. tonycstech

    tonycstech Active Member

    Joined:
    Dec 16, 2013
    Messages:
    606
    Likes Received:
    196
    How about this ? Here i cover not only thermostat switch but how i connected my fans.
    I hope this make sense.
    I used free program http://meesoft.logicnet.dk/DiagramDesigner

    EDIT: I changed the way thermostat works. Its now just a matter of getting it to your nozzle and flipping the switch when u want to leave. Printer will shutdown when print is completed once nozzle cools down.
    I think i am going to do just that. Attach it directly to the nozzle. My e3D has a extra hole in it so attaching it would not be that difficult.
    Perhaps attaching it to the board betwin the fins would be better solution, i dont know.
    Let me know what u think.
    Diagram.jpg
     
  7. SteveC

    SteveC Well-Known Member

    Joined:
    Jun 12, 2013
    Messages:
    894
    Likes Received:
    316
    Tony,
    FYI that bimetal temp switch's 250V rating is a max rated specification. It will work fine at 110V or even at 1V.
     
  8. SteveC

    SteveC Well-Known Member

    Joined:
    Jun 12, 2013
    Messages:
    894
    Likes Received:
    316
    Wouldn't it be simpler to use the RAMPS board PS_ON output pin to control a relay?

    http://reprap.org/wiki/G-code
    http://reprap.org/wiki/Marlin
    • M80 - Turn on Power Supply
    • M81 - Turn off Power Supply

    The PS_ON pin is right next to the reset button on the RAMPS board. I am not sure what the default state on the Arduino firmware is. The on and off commands would just be added to the custom gcode on startup and job complete. This is in the Slic3r Printer Setting/ Custom G-code menu.

    Has anyone tried this? I assume that PS_ON is set HI/5V on M80 code. I will look into it when I get a chance.
     
    2 people like this.
  9. tonycstech

    tonycstech Active Member

    Joined:
    Dec 16, 2013
    Messages:
    606
    Likes Received:
    196
    M81 blinks LCD and nothing is happening. Unit is still powered up
     
  10. SteveC

    SteveC Well-Known Member

    Joined:
    Jun 12, 2013
    Messages:
    894
    Likes Received:
    316
    Hi Tony,
    URGH - I just typed a long winded reply and the forum page crashed on me and I lost the typing, I should know better... Here is a second try at it from a text editor:

    The M80 and M81 commands control the RAMPS P_ON pins logic state. These commands and the pin are RAMPS board and Marlin firmware features and are not implemented in the Robo3D hardware so they will do nothing right now. You would need to add a relay controlled by the P_ON pin probably through a driver transistor. See P_ON here:

    I just attached a voltmeter to the P_ON pin and an adjacent ground (pin 1 on a servo connector). These are on opposite sides of the reset button on the RAMPS board. I found that the power-on/default state of P_ON is Low/ground and the G80 command also forces P_ON Low. G81 forces P_ON High/+5V. So this should work great for an auto shutdown.

    One complication is that the power supply will have a ramp up time for it to get to +12 Volts after the 110V is switched on with G80. So there needs to be a delay between the G80 command and the first stepper motor and heater commands. Typical supply ramp up times are few hundred ms but this needs to be checked for this particular supply. Looking further I found that G-code has a convenient delay command, G4.

    G4: Dwell


    Example: G4 P200
    In this case sit still doing nothing for 200 milliseconds. During delays the state of the machine (for example the temperatures of its extruders) will still be preserved and controlled.

    I tried this test case:

    M80 ;Turn on P_ON - Pin goes to GND​
    G4 P5000 ; wait 5 seconds​

    ; ... a bunch of XYZ test movement ...​

    G91 ; change to relative coordinates​
    G1 Z20.000 ; Raise Z to get extruder out of the way​
    G90 ; use absolute coordinates​
    G1 X10 Y120; go to a park location on the side​
    ; G28 X0 ; home X axis, buggy in some Marlin firmware​
    M104 S0 ; turn off temperature​
    M84 ; disable motors​
    M81 ; Turn off P_ON - Pin goes to +5V​

    It worked great. The pin went Low, it waited 5 seconds, did the movement and finally the pin went High. Just add the first two commands to the Slic3r Printer Settings / Custom G-code / Start G-code and the M81 command to the End G-code. The rest of the end code was my fix for the firmware bug that made the extruder mash into a few of my son's prints when they completed.

    I will look into the relay and driver and the power supply ramp up time when I get a chance.

    SteveC
     
  11. tonycstech

    tonycstech Active Member

    Joined:
    Dec 16, 2013
    Messages:
    606
    Likes Received:
    196
    I understand most of what you said here, what i dont understand is that we are on the same page or not.
    I am trying to get power supply completely off with thermostat and you are trying to turn off the board. Is that correct ?
    If you are trying to turn off the power supply, how do you go about doing it with G-Code when its nothing but a 110v to 12v converter (as far as am concerned) ?
    Does power supply and the board talk to each other ?


    The only way i see to turn of the power supply from 110v using board interpretation of the G-Code is:
    Custom end G-Code activates pins on the board that would send 12v to relay, causing 110v to disconnect power supply from 110v (assuming 110v is going thru a relay 1st to the power supply)

    Even so: its all good and dandy, but you may forget about the end code u know ?
    I think getting thermostat attached to the nozzle as i proposed earlier in my diagram is simpler/cheaper/faster.
     
  12. SteveC

    SteveC Well-Known Member

    Joined:
    Jun 12, 2013
    Messages:
    894
    Likes Received:
    316
    No - not just the board. It turns off the 12V main supply with an added 110V relay that is software controlled by commands embedded in the G-code.

    "Even so: its all good and dandy, but you may forget about the end code u know ?"​
    No - the power off command is automatically inserted by Slic3r by the Printer Settings setup. The user does nothing extra when starting each print.

    "I think getting thermostat attached to the nozzle as i proposed earlier in my diagram is simpler/cheaper/faster."​
    My problem with the thermostat design is routing the thick 110V wiring to the extruder heater is a bad idea. Even if the sensor was on the heated build platform having moving 110V wiring seems dangerous.

    The difference between the two solutions is that one uses a heat controlled relay (the bimetal switch) the other uses a logic controlled relay. I'll admit that the heat controlled relay is cheep. The problem is that getting the heat controlled relay to one of the heat sources requires routing high voltage wires to a moving platform. You could use the heat controlled relay to switch 12V which could then control another relay to shut down the 120V supply but that would be far more complicated than using the P_ON pin and a relay.

    BTW - remember that there are possibly two power supplies in the Robo3D. The 12V supply feeds the stepper drivers but if the USB is connected the computer feeds the AurdinoMega board. If the USB is unplugged then the 12V supply also feeds the AurduinoMega. This is the case if you have one of the LCD controllers feeding the G-code instead of your PC.
     
    2 people like this.
  13. tonycstech

    tonycstech Active Member

    Joined:
    Dec 16, 2013
    Messages:
    606
    Likes Received:
    196
    No argument
    However. If i use thermostat at the board, then i wont have to route so much to the bed or the nozzle.
    The 2 yellow fins that heat up as printer runs.

    I think that your idea is great but mine inst bad either.
    My problem is that if board does not get hot enough to close termostat before i flip the switch, i would have to wait before it does and hope it got hot enough :)
    Unless...... AH so many thoughts giving me headache :eek:

    How hot does board yellow fins get when printer is idle ? How long does it take for them to warm up without doing anything ?

    Another question:
    Is there a code to send 12v somewhere on the board where nothing is connected ?
    I want to try using some automotive 30-40 amps relay to trigger when code is sent at the end of print.
    Its much eazier i think the messing with the thermostat.
     
  14. tonycstech

    tonycstech Active Member

    Joined:
    Dec 16, 2013
    Messages:
    606
    Likes Received:
    196
    OK i have no clue where is that pin to turn off the power supply.
    Can you show me with a pic ?
    You said its right next to reset, but all i see is 3 pins with 5v output and 12v AUX next to it.
    I only see 5v that goes on and off, is that it ? How am i suppose to get 12v relay with that ?
     
  15. SteveC

    SteveC Well-Known Member

    Joined:
    Jun 12, 2013
    Messages:
    894
    Likes Received:
    316
    Sorry Tony but I have not looked at this in a while. The pin nearest the board edge next to the reset button is the P_On pin. It is a 5V logic level output that comes directly from the Arduino microcontroller. I never meant to imply that it was driven to 12V. You need to turn that 5V logic level into something that can control whatever relay you are using.

    The G80 command forces P_ON Low/GND. The G81 command forces P_ON High/+5V. The RAMPS board power on default for P_On is low. Remember to complete the circuit with the GND pin right next to the P_On pin.

    To avoid having to put together a transistor driver for a relay you can get one of these two products:

    Powertail switch II: $25.95, complete with plugs. easier to shield 110V wires, I think it will fit underneath the Robo.​

    Beefcake relay driver kit: $7.95, need to solder. Need to protect exposed 110V wiring and traces. But might be easier to attach to the power switch (see below) if needed.​

    These both accept the RAMPS/arduino logic level output on P_On. both are active High logic so a G81 or High command is needed to turn the AC on, G80 or Low will turn it off. Since the default of P_On is low the AC supply will start out turned off. If the RAMPS is connected to a powered USB line then it is fine but if it is powered by the Robo's internal AC supply (for example when using an SD Card reader like the XXL Smart LCD controller) then a second power switch is needed to get it started just like in your circuit above. Once it starts printing and the G81 command is given then the power switch can be turned off.

    So all that is required is one of the above relays, possibly a power switch and some wiring.

    BTW - thanks for putting the sideways E3D fan shroud up on Thingaverse. I modified it to hold my white LED module cut from this strip: http://www.amazon.com/gp/product/B00B2HK0LY?ie=UTF8&seller=A3UYUTM4BYYNKB&sn=LEDJUMP® , only $9.99 for 10 and it can be driven by the same 12V as the E3D fan. I'll put it up as a remix when I get a chance.


    Steve
     
  16. SteveC

    SteveC Well-Known Member

    Joined:
    Jun 12, 2013
    Messages:
    894
    Likes Received:
    316
    Oops - an important correction to the above. The GND is not right next to the P_On pin. Next to it is 5V. A GND can be taken from pin 1 of the Servos connector on the other side of the reset button. Pin 1 is closest to the board edge.

    Steve
     
  17. tonycstech

    tonycstech Active Member

    Joined:
    Dec 16, 2013
    Messages:
    606
    Likes Received:
    196
  18. SteveC

    SteveC Well-Known Member

    Joined:
    Jun 12, 2013
    Messages:
    894
    Likes Received:
    316
    Can't that 5v logic input relay handle the load alone? It is rated for 10A at 125V from:
    http://www.parallax.com/sites/default/files/downloads/27115-Single-Relay-Board-Datasheet.pdf
    That is 1250 Watts.

    The Robo's power supply lists the output as 12V at 30A. We are switching the 120V AC input side. So the supply power input will be 12V*30A = 330W times some factor for the supply's losses say 1.5 So at 120V we will only be switching less than 330A/120V*1.5 = about 4Amps.

    It looks like that 5v relay board has both NO and NC outputs so the NO one it will work fine with G81 command and with an extra power switch to bypass the relay you are all set. I'll order that relay board and try it. A bonus is that the board;'s control input is optically isolated. Thanks for pointing it out. It's kind of scary how cheep this stuff from China is. Just make sure you check it over well.
     
  19. tonycstech

    tonycstech Active Member

    Joined:
    Dec 16, 2013
    Messages:
    606
    Likes Received:
    196
    No its actually 30-40 amps, just right for the robo power supply to handle it but too much for the board. my reading shows its hardly 4.9v.
    it gives 4.9 if i run one end of the tested to the - on the power supply rather then the board negative pin. If i use board pins to measure, it hardly goes over 4v (did not measure amps).
     
  20. SteveC

    SteveC Well-Known Member

    Joined:
    Jun 12, 2013
    Messages:
    894
    Likes Received:
    316
    You can skip my rant below and jump to the "So finally in summary to make this work:" at the bottom. I realized how things fit together as I was typing and measuring voltages.

    -----
    I don't understand your statements above.

    "No its actually 30-40 amps, just right for the robo power supply to handle it but too much for the board."

    The Robo power supply is labeled as Amps at 12Volts on the output. The 120V input that we need to switch with the relay is therefore about 4 Amps at 120 Volts. The power is the same on both the input and output, about 330 Watts +- power supply inefficiency. (Sorry I mixed up a W and A in the post above in one place). Are you saying that the relay on the ebay board can't switch 4 Amps? ...... OK I just realized that by "board" you are probably talking about is on the RAMPS/Arduino pins.

    ..."my reading shows its hardly 4.9v."

    Are you talking about the P_On pin or the adjacent +5V pin? Or the VCC pin? We need both to feed the relay board. P_On is a direct output from the Atmel microprocessor on the Arduino board. It should be able to source over 20mA and keep close to a 5V level and it can sink more than that and keep the level close to GND. We are using the P_On pin to turn on and off an LED inside the opto-isolator in the relay board. Those levels are just fine to drive the LED/opto-isolator. The opto-isolator then drives a transistor on the relay board which switches +5V to energize the relay coil. The +5V is supplied by the RAMPS/Arduino pin adjacent to P_On. From: http://www.parallax.com/sites/default/files/downloads/27115-Single-Relay-Board-Datasheet.pdf , the relay coil requires 71.4 mA nominal at 5V to energize. The 5V supplied by the Arduino's regulator should be fine for this.

    " it gives 4.9 if i run one end of the tested to the - on the power supply rather then the board negative pin. If i use board pins to measure, it hardly goes over 4v (did not measure amps)."

    I really don't understand this. If you are talking about the P_On pin relative to it's local ground reference then this is what I would expect. Measuring "amps" on any pin does not make sense unless you put a load to GND on it to see what current it will source. I have no idea what the 4V comes from. Nothing should be 4V on the board unless a pin is loaded down.

    Anyways - I just looked at the pins on the RAMPS board labeled 5V and VCC that are next to P_On. The 5V pin on my board looks to be at 0V and the VCC reads at 5V when the Robo's power supply is turned on. VCC reads 4.9V or so when the Robo's PS is off and the USB is plugged in which makes sense. Looking at the schematics I just realized that the 5V pin is meant to be jumpered to the VCC pin next to it if you want to supply 5V to the Servo connectors that aren't being used. OK this makes sense.

    ---
    So finally in summary to make this work:
    • Connect the RAMPS VCC pin (two inboard from the P_On pin) to the relay module board's VCC. Connect P_On to the relay module board's IN pin.
    • Connect a ground pin from the other side of the reset switch nearest the RAMPS edge to the relay module board's GND pin. The outer two terminals of the relay module board (the NO/normally open ones) go between the Robo's hot 120V line and the Power Supply.
    • If the Robo is going to run stand alone with an SD card reader an no USB plugged in then a second power switch is needed that jumpers across the relay. This is to get the system started until M81 is asserted.
    • The G-c0de startup script then contains:
    M81 ;Turn on P_ON - Pin goes to +5V
    G4 P5000 ; wait 5 seconds
    • The G-code finish script contains:
    M80 ; Turn off P_ON - Pin goes to GND

    This will work and it it pretty simple. The relay module will support the Robo's supply load and the Arduino can drive the module's control input.

    I ordered one of the relay modules and will try it next week.

    Steve
     

Share This Page