g code

Tagged: ,

This topic contains 6 replies, has 4 voices, and was last updated by  Pavel 4 weeks, 1 day ago.

  • Author
    Posts
  • #15168
    Profile photo of Apostolis
    Apostolis
    Participant

    Hello to every one!

    Could someone please send me a full, simple g code for 3d printing with comments to understand how it works? For example to print a cube!
    Thanks!

  • #15180

    Daniel F
    Keymaster
  • #15181

    Daniel F
    Keymaster
  • #15194
    Profile photo of Italo Soares
    Italo Soares
    Keymaster

    Hi @printer!.

    Well, if you want to write the full g-code, be prepared for writing about 5000 lines for a 10x10x10 cube (mm), haha.

    Anyway, take a look at this guide that i made last year, it might help you to understand what is going on, and what each gcode means: https://3dprinterchat.com/2016/02/3d-printer-g-codes/

  • #15197
    Profile photo of Apostolis
    Apostolis
    Participant

    Hello @Italo,

    You are right! Hahahaha! I work on a project and i want to tell the printer just to hit in 4 points. I need a g code to see how i can start a programme, to set the temperature in 230 C, to wait until the extruder reach this temperature, to start the fans working and then to close all these and close the programme with correct commands, for my printer’s safety. For this reason, i need a guide g code, to start and end a g code, without the part of printing.

    Of course, I could desing 4 little circles and put them on simplify, to do this! But i want to do something more formal!

    Please someone help me! 😛 🙂

  • #15201
    Profile photo of Apostolis
    Apostolis
    Participant

    I wrote this code to get my printer two points, without having fillament in the extruder:

    ;Sliced at: {day} {date} {time}
    ;Basic settings: Layer height: {layer_height} Walls: {wall_thickness} Fill: {fill_density}
    ;Print time: {print_time}
    ;Filament used: {filament_amount}m {filament_weight}g
    ;Filament cost: {filament_cost}
    ;M190 S{print_bed_temperature} ;Uncomment to add your own bed temperature line
    ;M109 S{print_temperature} ;Uncomment to add your own temperature line

    G21 ;metric values (mm)
    G90 ;absolute positioning
    M82 ;set extruder to absolute mode
    M107 ;start with the fan off

    G28 X0 Y0 ;move X/Y to min endstops
    G28 Z0 ;move Z to min endstops

    G1 Z15.0 F{travel_speed} ;move the platform down 15mm

    ;G92 E0 ;zero the extruded length
    ;G1 F200 E3 ;extrude 3mm of feed stock
    ;G92 E0 ;zero the extruded length again
    ;G1 F{travel_speed} I NEED THAT?????????????????????????????????????????????????
    ;Put printing message on LCD screen
    ;M117 Printing…

    M104 S30 T0 ; T = 30C
    G90 ; absolute
    G28 ; go to (0,0,0)
    G28 X ; do nothing
    G4 P2000 ; wait 2 sec, do nothing
    G28 Y ; do nothing
    G4 P2000 ; wait 2 sec, do nothing
    G28 Z ; do nothing
    G4 P2000 ; wait 2 sec, do nothing
    G0 X0 Y0 Z50 ; go to (0,0,50)
    G4 P2000 ; wait 2 sec
    G0 X10 Y10 Z50 ; go to (10,10,50)
    G4 P2000 ; wait 2 sec
    G0 X10 Y10 Z10 ; FIRST POINT (10,10,10)
    G4 P2000 ; wait 2 sec
    G0 X10 Y10 Z50 ; go to (10,10,50)
    G4 P2000 ; wait 2 sec
    G0 X15 Y15 Z50 ; go to (15,15,50)
    G4 P2000 ; wait 2 sec
    G0 X15 Y15 Z10 ; SECOND POINT (15,15,10)
    G4 P2000 ; wait 2 sec
    G0 X15 Y15 Z50 ; go to (15,15,50)

    ;End GCode

    M104 S0 ;extruder heater off
    M140 S0 ;heated bed heater off (if you have it)

    G91 ;relative positioning
    ;G1 E-1 F300 ;retract the filament a bit before lifting the nozzle, to release some of the pressure
    ;G1 Z+0.5 E-5 X-20 Y-20 F{travel_speed};move Z up a bit and retract filament even more
    G28 X0 Y0 ;move X/Y to min endstops, so the head is out of the way

    M84 ;steppers off
    G90 ;absolute positioning
    ;{profile_string}

    Travel speed= 200 is ok?

    Do you think that it will work??

  • #15770

    Pavel
    Participant

    Unless likes, write translator.

You must be logged in to reply to this topic.