A List of M- and G commands as used by the CraftBot, some specs and UI shortcuts

Edit 23-9-2016. Copy of this post here.

EDIT: this first post of the thread will be updated as knowledge progresses... If you find some more info about the effect of M/Gcodes, please post it here, so I can update this list.

Specs:
Microprocessor Atmel ATSAM3X8E ARM CORTEX M3 84 MHz
Stepperdrivers: DRV8825
MosFET International Rectifier IRLH5034PbF
Thermistor extruder: 100k NTC. Most Likely EPCOS 100K Thermistor B57560G104F

Battery CB+ PCB: CR2032 or CR2025.

Extruder Heater: 12V 40W / CB PLUS = 24V
Bed Heater: ? silicon

Extruder fans: 40x40x10 mm, 12V, 6000 rpm. Maybe to replace with Sunon MB40101V2-A99



Lineair movement

XY Lineair bearings (8 pieces) linear bearings are all 8mm x15mm x 24mm. Buy quality: like IKO. They are fastened by tiny grub screws!

Replacement possible with plastic bearings: Drylin RJ4JP-01-08. Smooth rods needed to be replaced too as the original ones are slightly to thick.

The XY smoothed rods are all 8mm.
The Z smoothed rods are both 12mm

steppermotor 17HS3001-20B (40 N-cm / shaft 5mm, NEMA17
Motor step angle: 200/rev
Driver microstepping: 1/32 : 6400 steps for 1 rotation

Belt pitch BELT GT2: 2mm. The belt lengths are 132cm and 128cm.
Pulley 20 teeth x2mm= 40mm per rotation = 3200/40=80 steps per mm for XY movement EDIT: apparently I missed something when trying it with another electronics, or CoreXY needs double steps: it turned out it needs 160 steps per mm

Z screw pitch TR10x2: it needs (200 x 32) /2mm pitch = 3200 steps for 1mm Z height. EDIT, but Oh No! In practice I had to tweak it to 3050 steps for 1mm Z height (also when trying with another electronics).



Filament Gear


Filament Gear: diameter 10.8mm x pi = 33,9292 mm per rotation. Stepper: 200×32=6400 steps per rotation, so per 1mm Raw filament it needs 6400/33,9292=188.628 steps for the E (T0 extruder).
Filament gear: inside diameter:5mm, Outside diameter:10.8mm, Height:12mm, Number of teeth:38, Fixing hole:M3
(http://www.ebay.com/itm/5mm-38-teeth-Makerbot-3D-Printer-Kit-Feeding-Wheel-Extruder-Drive-Gear-/111682426600?ssPageName=ADME:L:OC:NL:3160)

Stepper frequencies

There are just two fixed frequencies for the stepper: 42000/13 Hz and 42000/40 Hz. . With the extruder doing about 188 steps per millimeter, the speeds are about 17 mm/s and 5.5 mm/s.

Max Speed limitation

At the moment the max XY speed is hardcoded in the firmware at a max of 120mm/s

General:

The Firmware will report an error -and stops printing- when there is a character as "(" or ")" is encountered when executing Gcode.
Simultaneous axis movement depends on the GCODE. For example if you send G1 X100 Y80 Z50 E10 in one line, this means that CraftBot will execute 4 movements at the same time with interpolation, thus all the movements will be started and finished at the same time. Slicers most often separate these commands by new line characters, for that reason they are not executed at the same time.
The left-front bed corner seems to be at X8 Y0, in stead of X0 Y0. Abjects are 8mm shifted because of that. Adjust in the slicer -if possible- to be able to print at the complete print area.

You can add in the startGcode of each slicer to following lines (after heating)

G1 X8 Y1 E10; to prime the extruder 10mm and move to the real bed corner
G92 X0 Y0 E0; reset X,Y and E value to zero



G codes

G0: Linear move: E F X Y Z

same function as G1? (EDIT: G0 seems to result in more un-accelerated moves than G1 !?)



G1: Linear move: E F X Y Z

Normal move E=extrusion in mm Raw filament (before heated) , F=speed in mm/minute(not seconds), XYZ=position: all positioned to a absolute origin. Without the E value it's a travel move, wit the E value it's a print move, simple said.



G4: Dwell: P S Limited to 5 seconds.

A wait command: P=millisecond, S=second, So G4 S4 is a 4 second wait



G20: Set units to inches. for the no-standard countries ;-



G21: Set units to millimeters. for the rest of the world...



G28: Move to origin: X Y Z Homing command, XYZ axis to the endstops



G90: Set to absolute positioning.

The normal setting: the X0 Y0 Z0 is at the left-front corner with the CraftBot, the build plate at the highest point: all XYZ points are absolute to the X0,Y0,Z0 point



G91: Set to relative positioning. All the following XYZ commands are relative to the last point



G92: Set position: E X Y Z

Most used is the G92 E0 command, to reset the Extrusion value each layer, to avoid very high E-values at the end of the print when not done so



G101: Relative linear move: E F X Y Z Same as G1, but all coordinates relative to the last position



G197 pauses the print and move the head to X0, Y100



M codes

M18: Disable stepper motors. The motors turned off and more or less able to moved by hand



M82: Set extruder to absolute mode. ???? makes the extruder interpret extrusion as absolute positions.



M83: Set extruder to relative mode. ???? makes the extruder interpret extrusion values as relative positions.



M84: Stop idle hold: S To turn the motors off after a period of time: M84 S60 will turn them off after a minute



M104: Set extruder temperature: H L S ???? I don't know what H L is, S is temperature, So M104 S220 sets the extruder to 220 degrees



M105: Get extruder temperature: P T Feedback about the extruder temperature



M106: Turn cooling fan on: H L S ???? M106 S255 is full speed? What is H and L? Terminal feedback: ok S:255 H:255 L:50



M107: Turn cooling fan off. ???? Duh.. only for the two print cooling fans, not the extruder fan.



M109: Wait Head Temperature: S

Set the extruder temp and wait for that temp to be reached before executing following commands
It looks like, it stops waiting if the temperature is within a 3 percent range of the set temperature, in Celsius. Eg. it is += 6 C at 180 C, but += 8 C at 240 C.



M110: Set current line number. ???? The number of the line of the list of Gcode commands



M114: Get current position.

???? This causes the machine to report its current X, Y, Z and E coordinates to the host.
Terminal feedback: ok X:60.21 Y:35.74 Z:9.47 E:0.00



M115: Get firmware version.

???? Request the Firmware Version and Capabilities of the current microcontroller
Terminal feedback: PROTOCOL_VERSION:0.1 FIRMWARE_VERSION:1.1.6197 FIRMWARE_NAME:pr3Dator MACHINE_TYPE:CraftBot EXTRUDER_COUNT:1



M117: Get zero position.

???? eport the X, Y, Z and E coordinates in steps not mm to the host that it found when it last hit the zero stops for those axes.
No terminal feedback



M140: Set bed temperature: H L S Same as M140, but for the bed.



M190: Wait Bed Temperature: S Same as M109, only for the bed.



M300 : Beep. P S (P is duration 100 is one second: S is pitch: 3 is high 500 is low.

This command is not waiting thus it attempts to play the sound at once, but since there is an ongoing sound (first line) not other M300 commands are interpreted. Try to use this with the G4 command. M300 followed by a G4 and repeat.



M906: feedback about the set motor currents: E X Z

M906 X75 if you want to set X & Y stepper motor value to 75.
Default setting (E44,X44,Z33) This function is replaced by dynamic current control.



M907: Set decay mode: A B E Z ok Decay A:0, B:0, Z:0, E:0,



M1000: List supported commands. ???? That way I started with this list ;-)



M1002: Get unique ID: S ???? The ID of the specific CraftBot

Terminal feedback: My unhackable ID nummer in HEX probably: 12008, 0x314e304d08, 0x3230373108, 0x3231303908



M1003: Get firmware version: S

???? the firmware version loaded to the CraftBot
Terminal feedback: ok pr3Dator version: 1.1.6197 – 2014-12-18/1



M1004: Get HMI version. ??? Terminal feedback: *HMI version: 0.0.1



M1006: Set limits s=1 Case / S=2 Head: H L S

Psanyi (Sandor) has found out that adding some M codes to the header (startGcode) let the extruder fan spin faster. There is a
way in the stock firmware to modify the peek fan "aggressiveness". The non-secret code is M1006S2, about M1000 tells this:
"- M1006: Set limits s=1 Case / S=2 Head: H L S"
The way it works is this: the firmware measures the head temperature, and if it is greater, than 80C, then it computes a value:
X = 50+TEMPERATURE/2
This in turn determines the duty cycle of the fan in 0-255 range:
DUTY = X*((H-L)/256)+L
These L and H values can be set with M1006 and the defaults are H=255, L=50.
Either you can solve the equation :-) or try different values for H, but anything over 255 will help you.
You can mess with L too, for example M1006S2LxHx sets the fan fixed at x.
You can modify your head fan cooling with the M1006 S2 code. The default is M1006 S2 L50 H255. Although it seems, like those are limited to 0-255 range, but in fact they are not. With higher H values you can speed up your fan, try M1006S2H300, M1006S2H350, etc.

To spin the extruder fan fast (as liked by my E3d metal hotend) I added this line to the startGcode:

M1006 S2 H350 ; spin the extruder fan faster



M1014: Get ADC values.

???? the readout of temps and voltage?
Terminal feedback: ADC: 20C, 19C, 22.5C, 12.0V



M1015: Get PWM duty.

???? PWM value to control internal extruder pressure. S255 is full pressure.
Terminal feedback: Head:0, Bed:0, Obj:0, Peek:0 Case:255



M1114: Get machine coordinates.

???? feedback to PC about the XYZ position
Terminal feedback A:0 B:0 Z:21787 E:0



M1115: Get queue.

???? the queue of commands sent to the printer?
Terminal feedback: X0 Y0 Z0 E0



M1160: Fan control (Case,Head,Obj): C H O

M1160 H255 makes the extruder fan spinning faster, but it's overrides quickly and returns to default.



M1200: Set feed properties: F H L minimum(L), maximum(H) and multipler(F)

Works only with the terminal window. L:600 H:7200 F:1.00



M1201: Set axis ratio: E X Y Z Here you can set a multiplier for each axis.

This is geometry, so if you want to change the size of the printed object, but you have the gcode only: M1201 (default 1.0) Works only with the terminal window.



M1202: Set axis soft limit: E X Y Z

???? The values specified set the software limits for axis travel in the positive direction.?
no feedback in terminal



M1203: Set XY acceleration: A D F (values changed with the firmware from 1-1-2016)

default: M1203 A2000 D2000 F240

experimental faster acceleration: M1203 A3000 D3000 F1200
M1203 A = Acceleration. When set to 0, the acceleration is disabled. Causing more vibration. The higher the number, the steeper the acceleration.
M1203 D = Deceleration. When set to 0, the deceleration is disabled. Causing more vibration. The higher the number, the steeper the acceleration.

M1204: K1.0 E shift, experimental

The "K" is the correction parameter specified in potato units. The default is 1.0 potato. This one works the best when LH=0.2mm
M1210: The default value is M1210 K0 F2400 (which means it's not used at the moment by CraftUnique, but it still works)

This is an essential feature to compensate for the delay in response of the extruder pressure related to accelerated XY movement.
The corner compensation has a K parameter, that is the strength of the compensation, and an F parameter, that is the minimum speed, that it applied to. The default is
M1210K1F1200, looks good for a generic PLA print.

M1300: Set extruder PID: D F I P W

Extra parameter, F, meaning "Fan Correction"
Terminal feedback: ok S:255 H:255 L:50
An expert feature IMO. The PID controller algorithm involves three separate constant parameters, and is accordingly sometimes called three-term control: the proportional, the integral and derivative values, denotedP, I, and D. Simply put, these values can be interpreted in terms of time: P depends on the present-error, I on the accumulation of past errors, and D is a prediction of future errors, based on current rate of change What is the W value?



M1301: Set bed PID: D F I P W

extra parameter, F, meaning "Fan Correction" ???? Same as M1300 only for the Bed
Terminal feedback: Bed PID: P=25.00, I=0.10, D=0.00, W=100.00



M1400: Start heating and waiting: B E H P Q

B E H P Q B=bed temp E=extrusie H=extruder ok H<Head temp> B<Bed temp> E<Extrusion after heating(mm)>. All parameter are optional
Here is an example:
M1400 H220 B60 E20 (heat extruder to 220 degrees, the bed to 60 degrees, and after that extrudes 20mm filmanent)



The following commands are used for immediately pausing, but shouldn't be used by users:

M1401: Push: F X Y Z
???? Push the state of the machine onto a stack Current feedrate, and Whether moves (and separately extrusion) are relative or absolute?
no feedback in terminal

M1402: Pop: F X Y Z
???? Recover the last state pushed onto the stack.?
no feedback in terminal

M1403: Flush.
???? (stop excuting the Gcode and reset?)
no feedback in terminal



M4001 will display the current value of the Heated Bed (probably it is 80 now.)

To set a new max current for the bed: M4001 P70 should be ok.

M4002 P1: this will let the bed heating element to get as many current as it requires to heat up fast.



Commands for the experienced:

M4003 S270: sets max temp of the hotend, in this case 270c (At your own risk)

M6666 S69 does the reset. It really resets the main board, but no feedback to the LCD panel, so it won't show you the changes. For example if you heat up using the LCD and you issue this command the LCD still shows its heating up, but that is not true.

M6666 reset without parameters, but you won't see too much using this.



M6969 S69 erases the firmware.

Power Break and continue feature (only for CB+ and firmware 8886 and above):

Information I got from power coder Psanyi about the power break and continue feature:

The limits of restart-ability:

the gcode has to be in the top directory, or maximum 2 directories lower.
the file must have absolute coordinates with millimeter dimensions.
The restart process:

the program detects, that there was a failed print, finds the file and asks, what you want to do first: heat the head or home the XY. if you have chosen home, then it lifts up the head some, then goes to XY0.
after that it starts to scan the file, passing almost all M commands to the printer, good for your motor tweaks and stuff.
if finds the position, then waits for the temperatures to settle, and after that goes to pause. In pause you can extrude, tweak stuff, etc.
if you press play, then it resumes printing
Some hidden CraftWare features:

ALT+CTRL+x = FPS and other screen rendering information.
ALT+CTRL+c = Camera path editor. I have used this to create animations shown in our Indiegogo campaign video
ALT+CTRL+z = Show / Hide buttons and info panel

CTRL+right mouse click and move is a look around function.

December 19, 2014

Bart ter Haar Bart ter Haar
Service partner
1382 posts

83 replies


Thanks for taking the time to write this Bart.

M4003 S270: sets max temp of the hotend, in this case 270c (At your own risk)

"M1400: Start heating and waiting: B E H P"
H is head temp
B is bed temp
E is extruder extrude distance distance in MM
P is?????

"M4002 P1: max heating for the Bed (email from Attila) "
I was under the impression this changes the behavior of the heating order. IE heat the Bed and then heat the extruder kind of thing. Or it is it some kind of PWM mode at the start of heating to reduce power?

December 19, 2014

Matthew L Matthew L
Exalted
703 posts

Hi Matthew, I just saw I can edit the first post, so I will do that.
Thanks for your input, I will add the M4003.

About M4002, I will correct that, I searched my mail and what Attila said was:
we don't let the drive the maximum out from the PSU. However you can try the command M4002 P1 and this will let the bed heating element to get as many current as it requires to heat up fast.
Do have more info about it somewhere on the forum?

December 19, 2014

Bart ter Haar Bart ter Haar
Service partner
1382 posts

edit at the first post, because of Janos reply:
M4001 will display the current value, probably it is 80 now.
M4001 P70 should be ok. "

December 24, 2014

Bart ter Haar Bart ter Haar
Service partner
1382 posts

edit because of info of 3Dforms about the current of the XY steppermotors:
M906 X75 if you want to set X & Y stepper motor value to 75.

Edit:
You can send another M906 command and it will report back the new values.


Mmm, I got a feedback with: Default setting terminal feedback: A:33 B:33 Z:42 E:44.

December 24, 2014

Bart ter Haar Bart ter Haar
Service partner
1382 posts

@Bart,
I just tried the command again by sending "M906 X75" through CraftPrint. I suddenly heard a noise which I believed coming from the motor.

I then sent a "M906" and it reported the value "A:75 B:75 Z:42 E:44". I then sent another "M906 X33" command. Then sent "M906" again and it reported "A:33 B:33 Z:42 E:44". After a little while, the noise from the motor became a lot more quieter.

I don't know why your CB did not accept your M906 command. Maybe different firmware?

December 24, 2014

3DForms 3DForms
Superstar
1731 posts

My firmware version: pr3Dator version: 1.1.6299 - 2014-12-19/1

December 24, 2014

3DForms 3DForms
Superstar
1731 posts

Not different firmware: different operator!. It turned out to be an "human error" ;-) It's working as you described. Thanks for checking it!

December 24, 2014

Bart ter Haar Bart ter Haar
Service partner
1382 posts

Glad to see that M906 working as it should be.

As you have more experience than me, I hope that you can share the optimal settings once you have found it. :-)

Now, how to change the jerk settings? Anyone knows?

December 24, 2014

3DForms 3DForms
Superstar
1731 posts

General:
The Firmware will report an error when there is a character as "(" or ")" is encountered when executing Gcode.

December 25, 2014

Bart ter Haar Bart ter Haar
Service partner
1382 posts

CraftBot's latest firmware has a command which will wait until it heats up the head, the bed at the same time and when all done it will extrude the specified amount in millimeters.
Here is an example:
M1400 H220 B60 E20


post:
http://www.craftunique.com/forums/view-thread/270/#2494

December 25, 2014

Bart ter Haar Bart ter Haar
Service partner
1382 posts

M1203 A = Acceleration. When set to 0, the acceleration is disabled. Causing more vibration. The higher the number, the steeper the acceleration.
You can try it with 40-100 values.
D = Deceleration. When set to 0, the deceleration is disabled. Causing more vibration. The higher the number, the steeper the acceleration.
You can try it with 40-100 values.
Examlpes:
M1203 A0 D0 ; Disables acceleration / deceleration
M1203 A66 D66 ; Acceleration / deceleration stepness set to 66

M1201 Axis ratios. Here you can set a multiplier for each axis.
Example:
M1201 X2 ; The X axis coordinates will be multiplied by 2. G0 X10 causes to the head goes to X to 20mm.


post from attila
http://www.craftunique.com/forums/view-thread/127

December 25, 2014

Bart ter Haar Bart ter Haar
Service partner
1382 posts

What about the P in M1400 H B E P in your first post?

Is the P similar to M4002 P1 for heating mode?

December 25, 2014

3DForms 3DForms
Superstar
1731 posts

I don't know, I just try to put about everything I find in the first post. Otherwise I keep searching the forum.
About M4002 P1: that was according an email I got from Attila,
EDIT: the P value was just a feedback in the terminal window.

About the M1400: I just found a post about that.
I really wish there was more info, but I hope it will come soon.

December 25, 2014

Bart ter Haar Bart ter Haar
Service partner
1382 posts

Is it really so that travel moves are not accelerated at the moment (I saw it in the same post), but I can't imagine that. OTOH: the travel movement seems much slower than I'm used to with my other printers (of course with the same speed set). Maybe it's a restriction by the firmware: max feed?

December 25, 2014

Bart ter Haar Bart ter Haar
Service partner
1382 posts

Found this:
Simultaneous axis movement depends on the GCODE.
For example if you send G1 X100 Y80 Z50 E10 in one line, this means that CraftBot will execute 4 movements at the same time with interpolation, thus all the movements will be started and finished at the same time. Slicers most often separate these commands by new line characters, for that reason they are not executed at the same time.


http://www.craftunique.com/forums/view-thread/100

December 25, 2014

Bart ter Haar Bart ter Haar
Service partner
1382 posts

Is there a gcode to "just" extrude material?

What I am looking for is something like
M1400 H220 B60 E20

but without the H and B parts.. I don't want to override the temperature settings .. I just want to extrude a certain amount of material just right before the print starts (as the final line of my gcode.header in CURA)

January 4, 2015

Bixit219 Bixit219
Superstar
1428 posts

[Edit] Post removed.

January 4, 2015

3DForms 3DForms
Superstar
1731 posts

Bixit219 wrote:Is there a gcode to "just" extrude material?

What I am looking for is something like
M1400 H220 B60 E20

but without the H and B parts.. I don't want to override the temperature settings .. I just want to extrude a certain amount of material just right before the print starts (as the final line of my gcode.header in CURA)




G28 X0Y0 ;home xy
G28 Z0 ;home z
G91 ;relative movements
G0 F100 ;speed 100mm/sec
G0 X15 Y15 Z0.4 E10 ;purge nozzle - move to xy15
G92 E0 ; Reset extruder value to zero after purge.
G90 ;Absolute movements

That's my Cura start G-code.
Just before my print starts it extrudes filament and moves to X15 Y15 and drops Z to .4. It just leaves a little line of filament that you can remove with your finger.I've found it better than just extruding as it's less likely to curl back on the nozzle.
If you remove the X, Y and Z values it will just extrude the filament. Replace E10 with however much you want to extrude.

January 4, 2015

CorEire CorEire
Honored
257 posts

thank you!

January 4, 2015

Bixit219 Bixit219
Superstar
1428 posts

I solve this issue bu just doing a 1 line skirt. This takes care of the bad filament in the hotend and doesn't leave a splatter of filament on my table which gets stuck to my head sometimes.

January 4, 2015

Jacob Gift Jacob Gift
Revered
534 posts


Jacob Gift wrote:I solve this issue bu just doing a 1 line skirt. This takes care of the bad filament in the hotend and doesn't leave a splatter of filament on my table which gets stuck to my head sometimes.


It was actually more to "prime the pump" so to speak .. I have noticed (for whatever reason) it seems that the filament is slow to get extruding on the first layer unless I manually extrude a bit seconds before it prints.. ie. a 1 line skirt would never come out.

January 4, 2015

Bixit219 Bixit219
Superstar
1428 posts

Bixit219 wrote:
Jacob Gift wrote:I solve this issue bu just doing a 1 line skirt. This takes care of the bad filament in the hotend and doesn't leave a splatter of filament on my table which gets stuck to my head sometimes.


It was actually more to "prime the pump" so to speak .. I have noticed (for whatever reason) it seems that the filament is slow to get extruding on the first layer unless I manually extrude a bit seconds before it prints.. ie. a 1 line skirt would never come out.


Interesting that it would take that long for it start to extrude. I guess if it was a small part then I would do more lines but for larger parts I simply do one. I used to do 5 but that was overkill.

Good information though.

January 5, 2015

Jacob Gift Jacob Gift
Revered
534 posts

Any chance of getting the whole set of codes in a nice CSV file?

January 5, 2015

fmotta fmotta
Revered
653 posts

attila
There is an M command, which pauses the print and move the head to X0, Y100
M197
For add beep use
M300

January 17, 2015

Bart ter Haar Bart ter Haar
Service partner
1382 posts

Sorry, soon we finish the draft of the G/M commands document. Will post the link as available.

January 17, 2015

Attila Attila
Admin
314 posts

Is there an m command that does a slow extrude. I notice the purge command just sort blurts it out quickly. I was Loking for a command that works similar to the m1400 but without the hot end or bed heater commands. If you watch the m1400 the extrude is a nice slow normal speed like you get with the LCD extrude button.

January 17, 2015

Bixit219 Bixit219
Superstar
1428 posts

@ Bixit219: You mean something like:
G1 E10 F360
Is extruding 10mm of unprocessed fillament with speed 360mm/m, which is 60mm/s
I don't know the default LCD extrusion speed, you can change the F360 to resemble that.

When you put this priming / extrusion in your startGcode, add an G92 E0 after that, like:

G1 E10 F360
G92 E0

Because without the G92 E0 the first extrusion will retract probably 10mm first.

BTW, you probably noticed that Gcode produced by CraftWare is off-centre.
That's because the zero point at X0, Y0 is declared at the endstops and not the leftfront corner of the buildplate.

As it's with me about 8mm in X off (not Y), I have this added in the startGcode, so prints are centered properly:
G1 X8 Y0 F1200 ;move to the actual front left corner of the bed
G92 X0 Y0 ; and declare that the actual X0 Y0 point


Bart

January 17, 2015

Bart ter Haar Bart ter Haar
Service partner
1382 posts

@Bart

Thanks I will give it a try .. I have found to get reliable skirts and first layers I need to manually extrude a good amount of filament just moments before printing and I was hoping to replicate this manual step in CURA with gcodes .. Thanks I will give it a shot .. I haven't noticed the offset much but I am using Jacobs cura profile and that might compensated for already .. I will check .. thanks again.

January 17, 2015

Bixit219 Bixit219
Superstar
1428 posts

Bixit219 wrote:Is there a gcode to "just" extrude material?
G28 X0Y0 ;home xy
G28 Z0 ;home z
G91 ;relative movements
G0 F100 ;speed 100mm/sec
G0 X15 Y15 Z0.4 E10 ;purge nozzle - move to xy15
G92 E0 ; Reset extruder value to zero after purge.
G90 ;Absolute movements

That's my Cura start G-code.
Just before my print starts it extrudes filament and moves to X15 Y15 and drops Z to .4. It just leaves a little line of filament that you can remove with your finger.I've found it better than just extruding as it's less likely to curl back on the nozzle.
If you remove the X, Y and Z values it will just extrude the filament. Replace E10 with however much you want to extrude.


Just as a quick followup, since I'm the one that posted that code originally.
I'm under the impression that G91 and G92 have been depreciated in recent firmware in favour of the G101 command (thought for some reason craftware doesn't seem to recognize it). It seems if you use that command still it executes it at full speed instead of the intended slow speed. You can now replace that startup code with:

G28 X0Y0 ;home
G28 Z0
G101 X15 Y15 Z0.4 E12 ;purge nozzle - move to xy15

G92 E0 shouldn't be necessary if your slicer is using relative movements already.


P.S.: Thanks Funbart, was looking for M197 to automate pauses. For some reason it isn't listed with M1000.

January 23, 2015

Stan V Stan V
Friendly
96 posts

Yes I did notice it just spit out the filament at a high speed indifferent to the parameter I specified. Thanks for the follow up as I was really wondering if I had botched it up.

January 23, 2015

Bixit219 Bixit219
Superstar
1428 posts

Oh poobuckets, M197 doesn't actually work -_-
Oh, M300 still works. Guess I'll just beep it up and manually pause. Guess that's ok for now.

January 23, 2015

Stan V Stan V
Friendly
96 posts


Stan V wrote:
G92 E0 shouldn't be necessary if your slicer is using relative movements already.


I added the G92 E0 at the time because with the code the way it was, it was causing the extruder to retract to E0 after the initial extrusion. Wasn't used to gcode at the time so it was a quick easy fix to stop it from happening.
The filament curling back up issue has been sorted since I replaced the nozzle so I can just extrude outside of the build area now without the need for the move inwards.

January 24, 2015

CorEire CorEire
Honored
257 posts

I confirm M197 don't work, any update to make it work ?

January 28, 2015

Breton Breton
Beginner
18 posts

Confirmed. The M197 does not work with the current firmware. Any other ideas on pausing to switch materials besides manually?

February 5, 2015

REDRUM REDRUM
Beginner
4 posts

Theres any command to drop the Z axis all the way to the bottom? Cant find it anywhere and i really hate when the bed is almost on the top and cant reach my piece.

February 5, 2015

Joe Medina Joe Medina
Friendly
159 posts

Good idea. I always have to hold the down button after each print, but then again I leave all that stuff at the bottom.

February 6, 2015

Jaime Vigil Jaime Vigil
Exalted
747 posts

Breton wrote:I confirm M197 don't work, any update to make it work ?

The command is apparently G197 not M197, and does work fine.
Not sure if I got it mixed up or the original list was wrong, but either way it's usable and works the same as using the pause function mid-print.

February 9, 2015

Stan V Stan V
Friendly
96 posts

Thank Stan V I will test this as soon as possible !

February 10, 2015

Breton Breton
Beginner
18 posts

A few questions:

@Stan
After G197 command, I see it moves the head to X0Y100, but it then stops accepting commands. How do you unpause?

@Bart
In order to get the plate centered, do you mean I should replace the default gcode script header in CW of:

G28 X0 Y0
G28 Z0

With:

G1 X8 Y1 F1200 ; go to X8 Y1
G92 X0 Y0 ; declare that spot the new zero point.

Or does that go after the G28 commands?

Thanks!

February 19, 2015

Avianna Avianna
Friendly
156 posts

Hi, it goes after the homing command, so:

G28 X0 Y0
G28 Z0
G1 X8 Y1 F1200
G92 X0 Y0

February 19, 2015

Bart ter Haar Bart ter Haar
Service partner
1382 posts

About M109: I've tested what temperature it is really waiting for. It looks like, it stops waiting if the temperature is within a 3 percent range of the set temperature, in Celsius. Eg. it is +- 6 C at 180 C, but +- 8 C at 240 C.

February 27, 2015

psanyi psanyi
Exalted
757 posts

So is there an M code for "reset motion planner and get your head out of your butt"?? If so, I'd like to put it in my start.gcode.

Once in a while I will start a print and the motion planner will be completely flummoxed. It will segment circles and ratchet arcs (in other words, no apparent look-ahead).

I'll power cycle the machine and run the exact same print... it will be fine.

Yeah, I can power cycle the machine before every print.... but sheeesh....

March 29, 2015

Scott Booker Scott Booker
Friendly
143 posts

G0: Linear move: E F X Y Z
same function as G1? EDIT: G0 seems to result in more (unwanted) un-accelerated moves than when only using G1 !?

May 22, 2015

Bart ter Haar Bart ter Haar
Service partner
1382 posts

I added this in the first post, please add findings and check my findings if you want:

Specs:
Microprocessor Atmel ATSAM3X8E ARM CORTEX M3 84 MHz
Stepperdrivers: DRV8825
MosFET International Rectifier IRLH5034PbF
Thermistors: 100k NTC
Extruder Heater: 12V 40W
Bed Heater: ? silicon

steppermotor 17HS3001-20B (40 N-cm / shaft 5mm, NEMA17
Motor step angle: 200/rev
Driver microstepping: 1/32 : 6400 steps for 1 rotation

Belt pitch BELT GT2: 2mm
Pulley 20 teeth x2mm= 40mm per rotation = 3200/40=80 steps per mm for XY movement (CoreXY)

Z screw pitch TR10x2: it needs (200 x 32) /2mm pitch = 3200 steps for 1mm Z height

Filament Gear: diameter 10.8mm x pi = 33,9292 mm per rotation. Stepper: 200x32=6400 steps per rotation, so per 1mm Raw filament it needs 6400/32,9292=194,356 steps for the E (T0 extruder).

Filament gear: inside diameter:5mm, Outside diameter:10.8mm, Height:12mm, Number of teeth:38, Fixing hole:M3
(http://www.ebay.com/itm/5mm-38-teeth-Makerbot-3D-Printer-Kit-Feeding-Wheel-Extruder-Drive-Gear-/111682426600?ssPageName=ADME:L:OC:NL:3160)

June 4, 2015

Bart ter Haar Bart ter Haar
Service partner
1382 posts

Pulley 20 teeth x2mm= 40mm per rotation = 3200/40=80 steps per mm for XY movement EDIT: apparently I missed something, or CoreXY needs double steps: it turned out it needs 160 steps per mm[/b]

June 4, 2015

Bart ter Haar Bart ter Haar
Service partner
1382 posts

Edit first post: Z screw pitch TR10x2: it needs (200 x 32) /2mm pitch = 3200 theoretical steps for 1mm Z height. But Oh No! In practice I had to tweak it to 3050 steps for 1mm Z height. Me no understand no...

BTW, all this because of temporarely building in a RepRap/Marlin Circuit Board. Why? This is why.

June 10, 2015

Bart ter Haar Bart ter Haar
Service partner
1382 posts

@Bart,
I think Attila mentioned in the early stage of the IGG campaign that they changed to a 12mm leadscrew for Z.

Below link explains about Crossed CoreXY mechanism.
http://blog.fabtotum.com/blog/2014/04/04/belts-and-stuff-experiences-to-share/

[Edit]
Based on IGG update from Attila:
"CraftBot frame, 12 mm Z rods, quality threaded rod with Oldham coupler, Z blocks with linear ball bearings, energy chain end, 8 mm Y rods."

June 10, 2015

3DForms 3DForms
Superstar
1731 posts

Hi 3Dforms. (What's your actual first name? ), that 12mm was only for the smooth rods which keep the bed stable. The threaded rod or leadscrew is still 10mm. But that doesn't matter for the raise, or pitch of that threaded rod. It's only the raise per full rotation that counts.
For that 2mm pitch: that was based on a post of Janos in the 'early days': http://www.craftunique.com/forums/view-thread/299/#2835

I know how the CoreXY system works, I'm building a 3D printer with a build volume of 1m3 prints with that system, but I was surprised that the theoretical steps (80 steps for 1mm X or Y movement) was doubled, as I think to remember that I didn't needed that for my own printer. I simple counted the tooth of the pulley of the A extruder (20), with the belt pitch of 2mm and some high school math (2*pi*r), that was resulting in the circumflex of that pulley. Given the 200 steps / rev of the stepper, and the microstepping of 32, that was resulting in 80 steps er mm. But the needed steps were exactly multiply by two.
Maybe they have set it to 16 for microstepping? OTOH, the steps per mm for the extruder and the Z are in the ballpark of 32 microstepping.

The extruder turned out to be right, based on the gear I found on ebay:
Filament Gear: diameter 10.8mm x pi = 33,9292 mm per rotation. Stepper: 200x32=6400 steps per rotation, so per 1mm Raw filament it needs 6400/32,9292=194,356 steps for the E (T0 extruder).
Filament gear: inside diameter:5mm, Outside diameter:10.8mm, Height:12mm, Number of teeth:38, Fixing hole:M3
(http://www.ebay.com/itm/5mm-38-teeth-Makerbot-3D-Printer-Kit-Feeding-Wheel-Extruder-Drive-Gear-/111682426600?ssPageName=ADME:L:OC:NL:3160)


It was just the pitch of the Z, that was off: as I need 3050 steps for 1mm raise, give the 6400 steps for 1 rotation of the Z stepper, that's resulting in a raise of 1,04mm * 2 = 2,08mm per revolution of the threaded rod (which is non standard). I was thinking that maybe I had set a too high speed or acceleration, resulting in missing steps or so for the Z.


June 10, 2015

Bart ter Haar Bart ter Haar
Service partner
1382 posts

@Bart,
Call me Paul. :-)

I edited my comment and added Attila's feedback on IGG. It wasn't clear to me whether 12mm was for the smooth rod or the threaded rod, but thanks for the clarification.

While you're still waiting for the replacement main board, if you happened to have a bowden extruder, it would be fun to find out how fast the CB can print with a bowden extruder. :-)

June 10, 2015

3DForms 3DForms
Superstar
1731 posts

Hi Paul! I'm already adding an extra heater and thermocouple in the energy chain (pretty tight though, and half the CraftBot is disassembled). I have received the replacement board already, but it's fun to hack now I have a little time in between prints ;-). I make sure though that the original CB board can be mounted easily (as I miss the LCD pretty much).

June 10, 2015

Bart ter Haar Bart ter Haar
Service partner
1382 posts

Yes, CB's touchscreen color LCD display probably is among the nicest display for a 3D printer.

Not really fun to have to disassemble the CB. I replaced my X & Y smooth rods (the rods got scratched marks on them), plus linear bushings on my white CraftBot.

Btw, were you able to get the new main board or the original main board as replacement? I'm hoping it's the new main board. :-)

June 11, 2015

3DForms 3DForms
Superstar
1731 posts

White is the only real CraftBot ;-) My X and Y are making noise as well. I have printed about 800 hours already, so I assume it make sense they are worn a little. Are they all 8mmx15mm and 24mm length? You need 8 pieces right?

I got the original board. I don't mind, as I wanted it fast in case I wasn't able to get the Marlin board in. From that CraftBot I exhanged the HPB already by a 24V one and a separate power supply and temp regulator. That is fixing the main issue IMO.

A List of M- and G commands as used by the CraftBot, some specs and UI shortcuts

I have a second CraftBot that I want to keep original (and mainly printing PLA with)

June 11, 2015

Bart ter Haar Bart ter Haar
Service partner
1382 posts

Yes, the linear bushings are all 8mm x15mm x 24mm. I replaced mine with IKO bearings off ebay, not cheap but really good quality.

June 11, 2015

3DForms 3DForms
Superstar
1731 posts

Bushings? Are you sure? I thought that bushings are that oil soaked bronze sliders, and lineair bearings are sliding by a lot of little balls rolling on the surface of the rod.
Edit, found this thread: http://www.soliforum.com/topic/9847/bushings-or-bearings-doesnt-matter/
But you are right, you have to buy quality. I was often tempted to buy cheap ones, and have regretted it always...

June 11, 2015

Bart ter Haar Bart ter Haar
Service partner
1382 posts

I'm not a mechanical guy so don't know much about the difference between bearings and bushings. :-)

A lot of ebay items called it either bushings or bearings. Anyway, the part I bought is IKO ST81524UU.

June 11, 2015

3DForms 3DForms
Superstar
1731 posts

@3DForms: could you photograph the original bushings/bearings, if you still have them? An oblique angle would be nice, so we can see the inner side.

July 16, 2015

psanyi psanyi
Exalted
757 posts

@psanyi

Here is a cheap Chinese bearing, no stamp marking, only LM8UU on the top of the photo. Quality is poor. Bearing to bearing quality is different. You probably would have to buy many of them to pick good bearings from the bad bearings.
A List of M- and G commands as used by the CraftBot, some specs and UI shortcuts

Here is a CraftBot bearing, no stamp marking, only LM8UU on top of the photo. Quality is better than the cheap Chinese bearing.
A List of M- and G commands as used by the CraftBot, some specs and UI shortcuts

A List of M- and G commands as used by the CraftBot, some specs and UI shortcuts


Here is the NSK bearing I bought on ebay.
http://www.ebay.com/itm/NSK-Linear-motion-BEARINGS-LB81524-5PCS-/321795032981?pt=LH_DefaultDomain_0&hash=item4aec7a8795
I haven't installed them on my red CB yet. Waiting for the upgrade kits to do it all together.
Stamp marking, and build quality is better than CB bearing. These bearings are consistent. They fit and move quite nicely.
A List of M- and G commands as used by the CraftBot, some specs and UI shortcuts

A List of M- and G commands as used by the CraftBot, some specs and UI shortcuts

A List of M- and G commands as used by the CraftBot, some specs and UI shortcuts

July 16, 2015

3DForms 3DForms
Superstar
1731 posts

Thanks for the photos. Now I know, that they are ball bearings indeed, and not just brass bushings.

July 16, 2015

psanyi psanyi
Exalted
757 posts

Some changes and additions in the first post made. A copy can be found here.

Some additions:
G4: Dwell: P S Limited to 5 seconds.

M300 : Beep. P S (P is duration 100 is one second: S is pitch: 3 is high 500 is low. This command is not waiting thus it attempts to play the sound at once, but since there is an ongoing sound (first line) not other M300 commands are interpreted. Try to use this with the G4 command. M300 followed by a G4 and repeat.

M1160: Fan control (Case,Head,Obj): C H O M1160 H255 makes the extruder fan spinning faster, but it’s overrides quickly and returns to default.

M1200: Set feed properties: F H L minimum(L), maximum(H) and multipler(F) Works only with the terminal window. L:600 H:7200 F:1.00


M1201: Set axis ratio: E X Y Z Here you can set a multiplier for each axis. This is geometry, so if you want to change the size of the printed object, but you have the gcode only: M1201 (default 1.0) Works only with the terminal window.

M1203: Set XY acceleration: A D F (values changed with the firmware from 1-1-2016) default: M1203 A2000 D2000 F240. Experimental faster acceleration: M1203 A3000 D3000 F1200.

M1300: Set extruder PID: D F I P W Extra parameter, F, meaning “Fan Correction”

M1301: Set bed PID: D F I P W. extra parameter, F, meaning “Fan Correction”

M1400: Start heating and waiting: B E H P Q B=bed temp E=extrusie H=extruder ok H<Head temp> B<Bed temp> E<Extrusion after heating(mm)>. All parameter are optional


Dangerous commands, don't use!

M4003 S270: sets max temp of the hotend, in this case 270c (At your own risk)

M6666 S69 does the reset. It really resets the main board, but no feedback to the LCD panel, so it won’t show you the changes. For example if you heat up using the LCD and you issue this command the LCD still shows its heating up, but that is not true.

M6666 reset without parameters, but you won’t see too much using this.

M6969 S69 erases the firmware.



February 7, 2016

Bart ter Haar Bart ter Haar
Service partner
1382 posts

M4003 isn't dangerous if used properly.
First, sure, you need an all metal hotend.
Let's imagine you are printing premium ABS, one that needs 275C, if you don't use this command printing is impossible. The firmware limits extrusion temperature to 260C.

February 8, 2016

Angelo Venosa Angelo Venosa
Honored
267 posts

I use it on a normal hotend :-) I hope, that the PEEK holds. I think all the images about melt J-heads on the internet are because of faulty temperature control, not just high temperature. The melting point on Wikipedia is 343 C and brass is not especially a good heat conductor, so the bolt with the brass-PEEK interface must be a bit cooler, than the core, where the heater and the sensor are.

On the other hand I understand the stance of CU, they want less problems for themselves and no in warranty replacements because of user errors.

February 8, 2016

psanyi psanyi
Exalted
757 posts

Nothing is dangerous when used properly, depending how 'properly' is defined ;-)

February 8, 2016

Bart ter Haar Bart ter Haar
Service partner
1382 posts

Added:
Thermistor extruder: 100k NTC. Most Likely EPCOS 100K Thermistor B57560G104F

March 19, 2016

Bart ter Haar Bart ter Haar
Service partner
1382 posts


psanyi wrote:I hope, that the PEEK holds. I think all the images about melt J-heads on the internet are because of faulty temperature control, not just high temperature. The melting point on Wikipedia is 343 C and brass is not especially a good heat conductor, so the bolt with the brass-PEEK interface must be a bit cooler, than the core, where the heater and the sensor are.


PEEK may have a melting point of 340+C, but it's maximum service temperature is 250C.

Ordinary 70/30 Brass has around 75% the conductivity of typical structural Aluminium alloys like 6061 (6082 in Europe) or 7075. Pure Aluminium is much more conductive, but too soft for most uses.

The Brass in the Craftbot hot-end extends quite a way into the PEEK insulator, about 14mm. That makes for quite a long melt zone.

March 22, 2016

Paul Compton Paul Compton
Beginner
41 posts

Paul Compton wrote:PEEK may have a melting point of 340+C, but it's maximum service temperature is 250C.

Thanks. Since that post I've switched to Bart's hotend, and also by your measurements I probably never reached more than 250 degrees.

March 22, 2016

psanyi psanyi
Exalted
757 posts

Can anyone confirm that the G4: Dwell command on their printer waits for the correct number of seconds?

For me, a G4 S4 waits for ~1.5-2 seconds, when I try with different values (less than 5 seconds) the printer waits for between 30-50% of the number of seconds specified.

(I have updated to the most recent version of firmware and am using the original CraftBot)

G4: Dwell: P S Limited to 5 seconds.

A wait command: P=millisecond, S=second, So G4 S4 is a 4 second wait

March 23, 2016

Derek Vogt Derek Vogt
Beginner
4 posts

Hi Derek, some else reported that too, I forgot to add that to the bugs and whishes list.

March 23, 2016

Bart ter Haar Bart ter Haar
Service partner
1382 posts

Thanks Bart ter Haar!

March 24, 2016

Derek Vogt Derek Vogt
Beginner
4 posts

This is not Gcode, but may fit into "some specs".

My head and object fans start to wear out, and I want to replace them. I want to keep the cooling about the same, and as there are several types of fan in this form factor (40x40x10 mm, 12V), I tried to measure the speed of the fans at full speed. Looks like, that they spin at around 6000 rpm.

In my practice, these small 40 mm fans all wear out the same: the sleeve starts to rattle, so I think I will change them to Sunon MB40101V2-A99 fans, because I read nice things about this "Maglev" bearing stuff.

Bart, you may want to add this "40x40x10 mm, 12V, 6000 rpm" info to the first post :-)

May 14, 2016

psanyi psanyi
Exalted
757 posts

Great! I hate the fans of the CraftBot. not only they are super cheap and wear, but they are 'loose' in the sleeve they are in, resulting in a clicking sound of the extruder fan at each Y movement. Of course i reported and told the CU folks, but I didn't got the impression they understood what I meant, and/or that they will search for better fans that cost more than 1 Euro a piece ;-)

Before adding: why didn't you choose fans with more airflow / pressure? As the fans now seem to have the same flow as produced by a coughing bee.

May 14, 2016

Bart ter Haar Bart ter Haar
Service partner
1382 posts

I've once read all what I can find about fans. Not that surprisingly air flow is proportional to the volume of the fan and the rpm. Bigger, thicker, faster fans work better. Here we can increase the rpm only, and the fastest fan I've seen in this size is 7000 rpm, not 6000, not much difference IMHO. And I'm kinda afraid to increase the rpm, I've heard some very whiny VGA coolers. A 40x40x15 fan would be better, but would run into the frame, if used as object fan. You may change the head fan, I think there is just enough room for it.

May 14, 2016

psanyi psanyi
Exalted
757 posts

There is probably, and you can always adjust the Y switch to make that 5mm more room.

About the fans, I did some reading too in the past, and as I understood it's not only about the air volume a fan is capable to produce, but also the max pressure it's capable off. That last one is of course more important when there's a tube or fan duct connected. As there will be little air volume when the fan has a low max pressure. I think to remember that the max pressure is mainly dependent of the form and amount of the fan blades of a given size of the fan.
But that's always the point I drown in the overwhelming amount of products and brands.

May 14, 2016

Bart ter Haar Bart ter Haar
Service partner
1382 posts

I have changed my first post with the latest information...

https://www.craftbot.nl/2015/07/07/list-of-m-and-g-commands-as-used-by-the-craftbot/

July 11, 2016

Bart ter Haar Bart ter Haar
Service partner
1382 posts

In my quest for tuning my new CB2, I looked at the M1210 command to adjust the K value. In this list the default value is said to be K1, but on my machine I get this when I query the command:

M1210
ok K:0.000 F2400.00:

So it would appear that the default value is maybe now 0?

And the default stepper current values also seems to have changed (X and Y is now 33, not 44 as written in the list):

M906
ok A:33 B:33 Z:33 E:44

There is also a new M-command in the CB2:

M7001: Set WIFI SSID/Pass.

Parameters unknown.

September 23, 2016

mroek mroek
Honored
285 posts

Yep, the previous default was 1, and now it is 0. I personally would use K1F1200, but that is just me :-), I've implemented that part and set the previous default to 1, but I was "not consulted" on the current default.

Also the M906 does not work for A and B any more, because it is overridden by the dynamic motor current control.

September 23, 2016

psanyi psanyi
Exalted
757 posts

Ah, thanks. Good to know, and perhaps Bart needs to update his document (and this thread).

Are you actually working on the CB firmware? Forgive me if I'm askin something obvious, but as you know, I'm new here.

September 23, 2016

mroek mroek
Honored
285 posts

Sometimes, but not regularly. The july version was the last I've touched.

September 23, 2016

psanyi psanyi
Exalted
757 posts

Ok, so you are doing contract work for them, then?

Out of curiosity, I guess that means you have all of the source code and can build your own, special, private versions of the firmware should you want to? :-)

September 23, 2016

mroek mroek
Honored
285 posts

Yes he can probably, assuming he got access to a PC in prison.....

I updated this and my original post with the latest info. If someone has more info: please contribute.

September 23, 2016

Bart ter Haar Bart ter Haar
Service partner
1382 posts

We probably can ask psanyi to sneak in a few extra special hidden features in the firmware. ;-)

September 23, 2016

3DForms 3DForms
Superstar
1731 posts

Yes, I have a very special custom firmware with the latest, bleeding edge technology ;-), unfortunately it is confined to my own Indiegogo CraftBot.

September 23, 2016

psanyi psanyi
Exalted
757 posts

Yes, I have a very special custom firmware with the latest, bleeding edge technology ;-), unfortunately it is confined to my own Indiegogo CraftBot.


I suppose it has bluetooth, GSM, HDMI and a 4K webcam supported....
Not to mention it can print very tasty meatballs as well....

September 23, 2016

Bart ter Haar Bart ter Haar
Service partner
1382 posts

Came out good. Im trying to put up a camera for home setup but still looking for info about the connectivity.

May 16, 2017

sean sean
Beginner
1 posts
To start a discussion or reply to a post please Login or Create an account.