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

Answered G-Code Question

Discussion in 'General Questions' started by Folk Hero, Jun 27, 2017.

  1. Folk Hero

    Folk Hero Member

    Joined:
    May 16, 2017
    Messages:
    34
    Likes Received:
    11
    Is there a G-Code that will turn a ROBO 1+ off after a print is finished?

    Tim
     
  2. mark tomlinson

    mark tomlinson ༼ つ ◕_ ◕ ༽つ
    Staff Member

    Joined:
    Feb 21, 2013
    Messages:
    23,914
    Likes Received:
    7,338
    Not without hardware modifications. There is nothing connected to the RAMPS card that will disconnect the A/C or the 12vdc supply. Add to that the fact that the Arduino brains in the printer will also power itself off of the USB port if connected...
     
  3. Folk Hero

    Folk Hero Member

    Joined:
    May 16, 2017
    Messages:
    34
    Likes Received:
    11
    Bummer.
     
  4. Ryan TeGantvoort

    Ryan TeGantvoort Active Member

    Joined:
    Mar 11, 2016
    Messages:
    343
    Likes Received:
    172
    Build a bracket on the back side of the bed. Once the print finishes, present the print by moving the bed all the way forward to trip the switch. Should work, I have thought about doing it.
     
  5. mark tomlinson

    mark tomlinson ༼ つ ◕_ ◕ ༽つ
    Staff Member

    Joined:
    Feb 21, 2013
    Messages:
    23,914
    Likes Received:
    7,338
    It would not be super-hard to add a relay to the RAMPS spare I/O pins (although it would require converting to a standard RAMPS, but that is not hard either) and then you could use some existing Marlin GCode to control those I/O pins to power-down the printer. You would only be able to power down the A/C stuff, not the USB stuff, but that is the majority of it anyway.
     
  6. Folk Hero

    Folk Hero Member

    Joined:
    May 16, 2017
    Messages:
    34
    Likes Received:
    11
    I like your idea. I could sleep at night without worrying about the printer running.
     
  7. daniel871

    daniel871 Well-Known Member

    Joined:
    Apr 18, 2015
    Messages:
    1,322
    Likes Received:
    510
    So long as you set it up so that the printer waits until the hotend has cooled back to ambient temps before presenting, that should be fine.

    Because if it just shuts off while the hotend is still at printing temps then the heat creep will give you a clog every time (because the hotend cooling fan will be immediately shut off with everything else).
     
    Ryan TeGantvoort and Geof like this.
  8. Folk Hero

    Folk Hero Member

    Joined:
    May 16, 2017
    Messages:
    34
    Likes Received:
    11
    What about putting a line in before shutoff like "G1 E-100 F1500 ;retract filament 100 mm @ 1500mm/min" to extract the filament before it turns off?
     
    mark tomlinson likes this.
  9. mark tomlinson

    mark tomlinson ༼ つ ◕_ ◕ ༽つ
    Staff Member

    Joined:
    Feb 21, 2013
    Messages:
    23,914
    Likes Received:
    7,338
    Sure, ending gcode block can handle that as well.
     
  10. Ryan TeGantvoort

    Ryan TeGantvoort Active Member

    Joined:
    Mar 11, 2016
    Messages:
    343
    Likes Received:
    172
    I think letting it (extruder and bed) cool down then presenting the print to shut it off would be a better solution.
     
  11. OutsourcedGuru

    OutsourcedGuru Active Member

    Joined:
    Jun 3, 2017
    Messages:
    752
    Likes Received:
    141
    I don't know if OctoPrint is being used but there's an included plugin called "GCODE System Commands". You'd install that from the plugins manager, let it reboot, come back into settings and establish a new GCODE like:

    OCTO 99 -> /usr/local/bin/poweroffRamps.sh

    ...in which case the shell script could use GPIO to toggle a pin per @mark tomlinson 's suggestion for the input side of the relay.

    Then in your GCODE at the end you could do a G4 P60000 (wait for 60 seconds for extrusion, say) followed by an OCTO 99.
     
  12. mark tomlinson

    mark tomlinson ༼ つ ◕_ ◕ ༽つ
    Staff Member

    Joined:
    Feb 21, 2013
    Messages:
    23,914
    Likes Received:
    7,338
    #12 mark tomlinson, Jun 28, 2017
    Last edited: Jun 28, 2017
    Geof likes this.
  13. OutsourcedGuru

    OutsourcedGuru Active Member

    Joined:
    Jun 3, 2017
    Messages:
    752
    Likes Received:
    141
    Hmm... if you can figure out how to call some code, I've been working on repositories lately that exercise GPIO in JavaScript.
     
  14. mark tomlinson

    mark tomlinson ༼ つ ◕_ ◕ ༽つ
    Staff Member

    Joined:
    Feb 21, 2013
    Messages:
    23,914
    Likes Received:
    7,338
    You can do it with GCode. This is what we did on the DLP printer we built, and we used Marlin to do it.
    There is a GCode command in Marlin to toggle some I/O pins on the RAMPS.

    http://neverstopbuilding.com/bed-lighting

    In the case of our DLP it was to drive a servo to open and close the shutter.
    Since there are no "known spare" pins on the C2/R2 controller that sort of hacking is not as likely :(
     
    OutsourcedGuru likes this.
  15. OutsourcedGuru

    OutsourcedGuru Active Member

    Joined:
    Jun 3, 2017
    Messages:
    752
    Likes Received:
    141
    Unless you wanted to desolder one leg of the Raspi's onboard Activity LED, say, and drive something. It's pin (BCM 47) and can be controlled via GPIO. But you'd have to turn off the standard activity routine at the system level to own it...

    $ echo none | sudo tee /sys/class/leds/led0/trigger

    And there's another one for the power LED (BCM 35).

    But they probably don't have a Raspi inside. :(

    Oh... and nicely done, btw.
     
  16. mark tomlinson

    mark tomlinson ༼ つ ◕_ ◕ ༽つ
    Staff Member

    Joined:
    Feb 21, 2013
    Messages:
    23,914
    Likes Received:
    7,338
    The R1/R1+ don't have a Pi inside :)
    There are a lot more options when you do that (and a lot more GP I/O pins to use).

    All the R1/R1+ has by default is the Arudino/RAMPS and the Arduino pins are inaccessible.
     
  17. Aflickted

    Aflickted Member

    Joined:
    Mar 25, 2016
    Messages:
    159
    Likes Received:
    21
  18. Folk Hero

    Folk Hero Member

    Joined:
    May 16, 2017
    Messages:
    34
    Likes Received:
    11
  19. Aflickted

    Aflickted Member

    Joined:
    Mar 25, 2016
    Messages:
    159
    Likes Received:
    21
    You're quite welcome. Not often that I'm sorta helpful here lol.


    Sent from my iPhone using Tapatalk
     

Share This Page