Centering a print
-
@jay_s_uk Certainly. And see some additional comments at the end:
; homeall.g
; called to home all axes
;
; generated by RepRapFirmware Configuration Tool v2 on Wed Apr 24 2019 22:25:27 GMT+0800 (中国标准时间)
G91 ; relative positioning
G1 Z5 F6000 S2 ; lift Z relative to current position
G1 S1 X410 Y408 F1800 ; move quickly to X or Y endstop and stop there (first pass)
G1 S1 X410 ; home X axis
G1 S1 Y408 ; home Y axis
G1 X400 Y400 F6000 ; go back a few mm
G1 S1 X410 F360 ; move slowly to X axis endstop once more (second pass)
G1 S1 Y408 ; then move slowly to Y axis endstop
G90 ; absolute positioning
G1 X205 Y200 F6000 ; go to first bed probe point and home Z
M98 Pdeployprobe.g ; deploy mechanical Z probe
G30 ; home Z by probing the bed; Uncomment the following lines to lift Z after probing
;G91 ; relative positioning
;G1 S2 Z5 F100 ; lift Z relative to current position
;G90 ; absolute positioningM98 Pretractprobe.g ; retract mechanical Z probe
; homex.g
; called to home the X axis
;
; generated by RepRapFirmware Configuration Tool v2 on Wed Apr 24 2019 22:25:28 GMT+0800 (中国标准时间)
G91 ; relative positioning
G1 Z5 F6000 S2 ; lift Z relative to current position
G1 S1 X410 F1800 ; move quickly to X axis endstop and stop there (first pass)
G1 X400 F6000 ; go back a few mm
G1 S1 X410 F360 ; move slowly to X axis endstop once more (second pass)
G1 Z-5 F6000 S2 ; lower Z again
G90 ; absolute positioning; homey.g
; called to home the Y axis
;
; generated by RepRapFirmware Configuration Tool v2 on Wed Apr 24 2019 22:25:28 GMT+0800 (中国标准时间)
G91 ; relative positioning
G1 Z5 F6000 S2 ; lift Z relative to current position
G1 S1 Y408 F1800 ; move quickly to Y axis endstop and stop there (first pass)
G1 Y400 F6000 ; go back a few mm
G1 S1 Y408 F360 ; move slowly to Y axis endstop once more (second pass)
G1 Z-5 F6000 S2 ; lower Z again
G90 ; absolute positioning; homez.g
; called to home the Z axis
;
; generated by RepRapFirmware Configuration Tool v2 on Wed Apr 24 2019 22:25:28 GMT+0800 (中国标准时间)
G91 ; relative positioning
G1 Z5 F6000 S2 ; lift Z relative to current position
G90 ; absolute positioning
G1 X200 Y200 F6000 ; go to first probe point
G30 ; home Z by probing the bed; Uncomment the following lines to lift Z after probing
;G91 ; relative positioning
;G1 S2 Z5 F100 ; lift Z relative to current position
;G90 ; absolute positioning
Further comments.
After reading the Duet3D documentation regarding the use of M574, I see that, as supplied, the code disobeys at least two M574 stipulations. ie:
-
Use a separate M574 command for each axis.
The code combines X and Y: M574 X2 Y2 S1 -
This command must be later in config.g than the M584 command that creates additional axes, or axes that have multiple motors and endstops.
M574 is several lines earlier than M584. For ref: M584 X0 Y1 E3 Z6:5:8:7 ; four motors, at 5, 6, 7, and 8
Cheers,
Derek
-
-
@Derek-F your M574 is fine as you're running such an ancient firmware!
You may want to consider starting a fresh with this and upgrading to 3.5.2
Oh and you shouldn't have an M587 in your config as it'll just wear out the flash on the ESP (wifi module) -
@jay_s_uk Thanks for the warning about writing M587 in config.g. I see a macro is recommended. I'm guessing that I could add one to the Troodon but I have no clue how to, nor when it should be invoked (once, every power up?).
Regarding upgrading to 3.5.2. Honestly, that scares me. I'm a mechanical engineer, dabbling in code through necessity. It has taken me 3-1/2 years (off and on) to get my first useable large print out of this Troodon. I have finally got there in slicer settings and a few mechanical mods.
If I upgrade, what kind of task do I have in front of me to get printing again? I think it might be unreasonable to expect the kind of handholding that I might need.
Even if I do upgrade (and I do realise it would be a smart move), I would still like to resolve this issue of centering the print on my current system. In doing this, I'll lean more about gcode, configuration and the way my printer works. I also have several projects waiting that need this size of printer.
Cheers,
Derek
-
@Derek-F said in Centering a print:
................... I then sent M500 to save the setting.
Ahhh - that could be what's screwing things up for you. When you save settings this way, it writes the values to another file called "config-override.g" which does exactly what the name suggests. That is to say, it overwrites any G or M codes that may be in config.g. When power is applied, the contents of config.g are read and applied, then if your config.g contains an M501 command (which it does) it will read and act upon any commands which are contained in config-override.g. So if you have anything in config-override.g which relates to axis dimensions, offsets, or position, these commands will supersede (overwrite) the previous values which were read from config.g. Which effectively means that editing values in config.g will have no effect (because they are being overridden by commands in config.override.g).
This is why personally, I never use M500, M501 and have no config-override.g file and instead only use config.g. In my opinion, having configuration values stored in two different locations simply leads to confusion and mayhem. You can either do as I do and stop using config-override.g and only use config.g, or make sure that if you make any changes, make then in config-override.g instead of config.g (but sooner or later, you'll forget and it will come back and bite you in the arse).
-
@deckingman Hmm, sounds a bit like CREO Parametric that has three possible locations for config.pro, each overwriting the previous commands.
I'd love to consolidate so allow me to define what I believe my steps would be:
- Copy the entire contents of config-override.g to the location of M501 in config.g
- Comment/delete M501 in config.g
- Comment out all of config-override.g (so recovery is possible) and add a first comment explaining what I have done and when.
Questions/comments:
- Do I keep the M500 as the penultimate command in config.g?
- Does the SD card contain any code that is automatically read at bootup?
- I don't currently see anything in config-override.g that might conflict with the settings I am working on. Have I missed something?
(config-override.g and config.g are included earlier in this thread)
I realise that, in this thread, I have asked a number of specific and implied questions, making it hard to respond to everything. I propose to tackle the issues raised one step at a time (overrides, macros, print centering, upgrade). Is that a reasonable approach? If topics are too diverse for "Centering a print", rap my knuckles and send me off to search for or start a new thread.
Cheers,
Derek
-
- M500 stores parameters and should never appear in config.g. M501 reads parameters. If you use config-override.g then it needs to be present at the end of config.g. If you don't use config-override.g then don't use M501.
- Only config.g and config-override.g if it's present.
- Something isn't right. The config.g you posted shows M208 for X to be zero and plus circa 400. If you had followed my instructions, these should be circa minus 200, and circa plus 200.
-
@deckingman Working backwards, I mentioned earlier that I was hoping to keep the current scheme (and just update the numbers slightly) but I will go back and follow your instructions on centering with + and - figures. I didn't need to touch the Y values but I presume I'll have to home those as well (or at least halve the current full Y figure and use that).
I also presume I change the origin in the slicer in the bed shape settings origin from X=0, Y=0 to half the bed sizes respectively.I do have a concern about using the center of the bed... what about all the code that currently refers to X400ish or Y400ish (like all the homex.g code)? There are probably dozens of instances all over the place.
I have no config.g or config-override.g on my SD card so it looks like that can be eliminated as a contributor to the issue.
It seems that my procedure was correct since you did not comment on it.
OK, off to work!
Thanks so much for your help.
Cheers,
Derek
-
@Derek-F I just made the edit to M208 and stored it in the printer.
They now read:
M208 X-202 Y-204 Z0 S1 ; set axis minima to end of safe travel.
M208 X202 Y204 Z510 S0 ; set axis maxima to match endstop location.However, when I homed the printer (from the screen on the printer) the extruder went to the back right as usual, but instead of going to the center to establish the Z value, it descended in the back left corner and the nozzle CRASHED into the heat plate (because the BLtouch sensor was well behind the heat plate). I switched the printer off in this condition.
What should I do when I next switch on?
What have I missed? (why did it try to find Z at the back right corner - it is due to one of the figures I was concerned about in my previous post?)
Cheers,
Derek
-
@Derek-F said in Centering a print:
why did it try to find Z at the back right corner - it is due to one of the figures I was concerned about in my previous post?
Your homez.g file probably contains a G1 command to move the head to bed centre before doing a G30 probe. Bed centre used to be about X200 Y200, but it is now X0 Y0. So you will need to change those coordinates in homez.g, and also in homeall.g if that code is in that file too.
-
@Derek-F You'll need to redo all your homing files. The origin is now set as the centre of the bed so if you want to probe the bed in the centre, you'll need move the print head to X=0 Y =0. i.e this line "G1 X200 Y200 F6000 ; go to first probe point" needs to be changed to "G1 X0 Y0 F6000 ; go to first probe point
Note that the position of the end stops can stay the same. Note also that any files you previously sliced with the origin set to one corner of the bed will need to be re-sliced because they will contain moves in the range zero to circa 400 whereas with the origin in the slicer set to the centre, the moves need to be in te range minus circa 200 to plus circa 200.
Edit posted while DC was typing. also, it appears my PC has the wrong time set.
-
@deckingman Thank you for your replies.
Before I switch on the printer, I'd like to have some idea of the procedure I'm going to follow to recover from the crash. Some time after power off, I tried unsuccessfully to raise the gantry slightly and take the pressure off the nozzle. When powered up, I can't use the move buttons until a homing operation is performed first (which I obviously cannot do).
If I opened the printer console and sent one of these commands, would it lift the gantry?
G1 Z10 F300
G1 Z+10 F300
G1 Z10
Or something else?
Do I need a G90 or G91 first?I am seriously concerned that the gantry is no longer level (ie: parallel with the bed) since it crashed in one corner and I tried to lift it slightly.
How should the gantry be leveled again?
Will my Z offset be incorrect?Cheers,
Derek
-
@Derek-F use
M564 H0
to allow jogging of the axis without homing -
@jay_s_uk Thank you. That allowed me to move the nozzle away form the bed.
I have changed my two M208 lines back to the 'as supplied' figures where the zero is at the front left corner. I think it prudent not to change to zero at the bed center until I understand every implication of doing so.
How do I get the gantry parallel to the bed now?
I see this code in config.g but when is config.g run? (is there a command in the print file?)
; --- z-axis stepper leveling configuration ---
M584 X0 Y1 E3 Z6:5:8:7 ; four motors, at 5, 6, 7, and 8
;M671 X420:420:-100:-100 Y380:-115:-115:380 S20 ; Z belts at 4 corners
M671 X-100:-100:420:420 Y380:-115:-115:380 S20 ; Z belts at 4 cornersDoes the above actually level the gantry?
Finally, will the crash have affected my Z offset?
Cheers,
Derek
-
@Derek-F config.g is ran at boot and loads all of your printers parameters into the firmware so it can be setup correctly.
G32
would go through the levelling process. This runs the bed.g file, which contains the locations to probe the bed for levelling -
@jay_s_uk It's idle and powered on. Should I just send G32?
Or do I need to home it first?
Cheers,Derek
-
@Derek-F you need to home first
-
@jay_s_uk That was all successful. Thank you.
Do you think I need to reset my Z offset after the crash?
Cheers,
Derek
-
@Derek-F you may do depending how hard the nozzle crashed into the bed.
You should also be running G32 before a print as the gantry/bed may have dropped whenever power has been turned off -
@jay_s_uk OK, I'll try a print and see how it goes.
Just checked and G32 is in my Start G-code routine.
BTW, is the following line bad to constantly write to memory (like the WiFi credentials)?
M550 P"VIVEDINO" ; Set machine name
-
@Derek-F no, thats fine. that just sets the machine name in the firmware