Mesh Confusion
-
Lots of users seem to be struggling with this at the moment. None of the other threads have worked for me.
I'm struggling to see how I can get a heightmap like this.
This is Troodon 400 with 4 z-axis motors. I can knock it way out of skew and run the bed.g on it an watch it measure all four corners then watch as the entire gantry jerks into being perpendicular with the bed.
I Home All.
Then Tram with G32.
Then Home All again, Z dead center.
Then run G29 S0 for the bed mesh.You see the height map that's generated. It's a fairly flat plane, seemingly what tramming should've resolved. Shouldn't it have?
RepRapFirmware height map file v2 generated at 2021-12-20 21:27, min error -4.036, max error 3.824, mean -0.418, deviation 1.898 axis0,axis1,min0,max0,min1,max1,radius,spacing0,spacing1,num0,num1 X,Y,10.00,410.00,21.00,400.00,-1.00,49.00,49.00,9,8 0, 0, 0, 0, 0, 0, 0, 0, 0 -0.197, 0.308, 0.836, 1.400, 1.999, 2.574, 3.185, 3.824, 0 -0.869, -0.310, 0.228, 0.798, 1.380, 1.971, 2.569, 3.215, 0 -1.620, -1.240, -0.400, 0.215, 0.781, 1.361, 1.969, 2.622, 0 -2.196, -1.804, -1.392, -0.925, -0.441, 0.036, 0.533, 1.067, 0 -2.795, -2.356, -1.935, -1.451, -0.956, -0.452, 0.069, 0.628, 0 -3.492, -3.130, -2.741, -2.291, -1.842, -1.389, -0.896, -0.381, 0 -4.036, -3.637, -3.213, -2.740, -2.240, -1.735, -1.219, -0.651, 0
-
Please share your config.g, homing files, bed.g, and mesh.g if used.
What z probe are you using?
-
@phaedrux Hi Phaedrux. Thanks for the assist.
BLTouch is the z-probe.
config.g
; Configuration file for Duet 3 (firmware version 3.3) ; executed by the firmware on start-up ; ; General preferences G90 ; send absolute coordinates... M83 ; ...but relative extruder moves M550 P"Troodon" ; set printer name M669 K1 ; select CoreXY mode ; Wait a moment for the CAN expansion boards to start G4 S2 ; Network M552 P0.0.0.0 S1 ; enable network and acquire dynamic address via DHCP M586 P0 S1 ; enable HTTP M586 P1 S0 ; disable FTP M586 P2 S0 ; disable Telnet ; Drives M569 P0.0 S0 ; physical drive 0.0 goes BACKwards M569 P0.1 S0 ; physical drive 0.1 goes BACKwards M569 P0.2 S0 ; physical drive 0.2 goes BACKwards M569 P0.3 S1 ; physical drive 0.3 goes forwards M569 P0.4 S0 ; physical drive 0.4 goes BACKwards M569 P0.5 S1 ; physical drive 0.5 goes forwards M569 P1.1 S0 ; physical drive 1.0 goes BACKards M584 X0.0 Y0.1 Z0.2 E1.1 ; set drive mapping M350 X16 Y16 Z16 E16 I1 ; configure microstepping with interpolation M92 X80.00 Y80.00 Z400.00 E727.00 ; set steps per mm M566 X2000 Y2000 Z602.65 E250 ; set maximum instantaneous speed changes (mm/min) M203 X20000 Y20000 Z1500 E3200 ; set maximum speeds (mm/min) M201 X1500 Y1500 Z500 E3200 ; set accelerations (mm/s^2) M906 X1200 Y1200 Z1200 E420 I60 ; set motor currents (mA) and motor idle factor in per cent M84 S60 ; Set idle timeout ; Multiple Z motors M584 Z0.2:0.3:0.4:0.5 ; assigning all the Z drives ; Axis Limits M208 X0 Y0 Z-5 S1 ; set axis minima M208 X400 Y400 Z480 S0 ; set axis maxima ; Endstops M574 X2 S1 P"io1.in" ; configure switch-type (e.g. microswitch) endstop for high end on X via pin io1.in M574 Y2 S1 P"io2.in" ; configure switch-type (e.g. microswitch) endstop for high end on Y via pin io2.in ; Z-Probe M574 Z0 P"nil" ; no Z endstop switch, free up Z endstop input M558 P9 C"io5.in" H10 R1 F300 T6000 A5 S0.02 ; BLTouch connected to Z probe IN pin M950 S5 C"io5.out" ; BLTouch connected to Z probe OUT pin that the PWM should spew from M574 Z1 S2 ; Set endstops controlled by probe G31 P50 X-2 Y22 Z1.13 ; Set Z probe trigger value, offset and trigger height (Is now Z1.13) M557 X10:410 Y21:400 S49 ; define mesh grid ; --- z-axis stepper leveling configuration --- ;M671 X-100:-100:420:420 Y380:-115:-115:380 S5 ; Z belts at 4 corners Formbot's numbers ??!?? M671 X-60.0:-60.0:460:460 Y-30.0:470.0:470.0:-30.0 S5 ; Z belts at 4 corners where the sliders are ; --- drive map --- ; _______ ; | 3 | 4 | ; | ----- | ; | 2 | 5 | ; ------- ; front ; Heaters M308 S0 P"temp0" Y"thermistor" T100000 B4138 C0 ;R4700 ; define bed temperature sensor M308 S1 P"temp1" Y"thermistor" T100000 B4138 C0 ;R4700 ; define E0 temperature sensor M950 H0 C"out0" T0 ; heater 0 uses the bed_heat pin, sensor 0 M950 H1 C"out1" T1 ; heater 1 uses the e0_heat pin and sensor 1 M307 H0 B0 R0.296 C925.8 D1.43 S1.00 V23.9 ; M303 PID Auto Tuning of the Bed heater M307 H1 B0 R2.493 C242.1 D10.67 S1.00 V23.9 ; M303 PID Auto Tuning of the Extruder heater M140 H0 ; map heated bed to heater 0 M143 H0 S120 ; set temperature limit for heater 0 (Bed) to 120C M143 H1 S280 ; set temperature limit for heater 1 (Extruder) to 280C ; Fans M950 F0 C"out4" Q500 ; create fan 0 on pin out4 and set its frequency M106 P0 S0 H-1 ; set fan 0 value. Thermostatic control is turned off M950 F1 C"out9" Q500 ; create fan 1 on pin out9 and set its frequency M106 P1 S1 H1 T45 ; set fan 1 value. Thermostatic control is turned on M950 F2 C"out5" Q500 ; create fan 2 on pin out5 and set its frequency (TEMPORARILY ZERO) M106 P2 S1 H-1 ; set fan 2 value. Thermostatic control is turned off M950 F3 C"out7" Q500 ; create fan 3 on pin out7 and set its frequency (TEMPORARILY ZERO) M106 P3 S1 H-1 ; set fan 3 value. Thermostatic control is turned off M950 F4 C"out8" Q500 ; create fan 4 on pin out8 and set its frequency M106 P4 S1 H-1 ; set fan 4 value. Thermostatic control is turned off ; Tools ;M563 P0 D0 F-1 ; define tool 0 M563 P0 D0 H1 F1 ; define tool 0 G10 P0 X0 Y0 Z0 ; set tool 0 axis offsets G10 P0 R0 S0 ; set initial tool 0 active and standby temperatures to 0C ; ---filament sensing--- ;M591 D0 P1 C"io_3" S1 ; extruder 0, simple sensor signal high filament present, pin connected to, enable when printing from SD ; --- firmware retraction --- ; Apparantly not used? ;M207 S2.5 R0 F6500 T4500 Z0 ; [ Snnn positive length to retract, in mm ] ; [ Rnnn positive or negative additional length to un-retract, in mm ] ; [ Fnnn retraction feedrate, in mm/min ] ; [ Tnnn feedrate for un-retraction if different from retraction, mm/min ] ; [ Znnn additional zlift/hop ] ; ---LED Color Driving--- M950 F6 C"1.out6" Q500 ; create fan 6 on pin out6 and set its frequency !!LED COLOR!! M106 P6 S1 H-1 ; set fan 6 value. Thermostatic control is turned off !!LED COLOR!! M950 F7 C"1.out7" Q500 ; create fan 7 on pin out7 and set its frequency !!LED COLOR!! M106 P7 S1 H-1 ; set fan 7 value. Thermostatic control is turned off !!LED COLOR!! M950 F8 C"1.out8" Q500 ; create fan 8 on pin out8 and set its frequency !!LED COLOR!! M106 P8 S1 H-1 ; set fan 8 value. Thermostatic control is turned off !!LED COLOR!! M106 P4 S000 ; TEMP STOP DRIVER FAN M106 P3 S000 ; TEMP STOP PAN FAN M106 P2 S000 ; TEMP STOP HEPA FAN
homeall.g (which is all the individual axis repeated)
; homeall.g ; I've edited this to be the three indiviual homes in classic order ; If anything is changed here check the individual axii ; ; ; homex.g ; called to home the X axis ; anything changed here needs to also be done in homeall.g ; G91 ; relative positioning G1 H2 Z5 F6000 ; lift Z relative to current position G1 H1 X400 F1800 ; move quickly to X axis endstop and stop there (first pass) G1 X-5 F6000 ; go back a few mm G1 H1 X400 F360 ; move slowly to X axis endstop once more (second pass) G1 H2 Z-5 F6000 ; lower Z again G90 ; absolute positioning ; homey.g ; called to home the Y axis ; anything changed here needs to also be done in homeall.g ; G90 ; absolute positioning G1 X200 F6000 ; get the X axis away from the X axis high limit to give the drag chain room to not compression bind on Y move. G91 ; relative positioning G1 H2 Z5 F6000 ; lift Z relative to current position G1 H1 Y400 F1800 ; move quickly to Y axis endstop and stop there (first pass) G1 Y-5 F6000 ; go back a few mm G1 H1 Y400 F360 ; move slowly to Y axis endstop once more (second pass) ;G1 H2 Z-5 F6000 ; (*** removed from homeall.g as it causes a pointless curtsy) lower Z again G90 ; absolute positioning ; homez.g ; called to home the Z axis ; anything changed here needs to also be done in homeall.g ; G91 ; relative positioning ;G1 H2 Z5 F6000 ; (*** removed from homeall.g as it causes a pointless curtsy) lift Z relative to current position G90 ; absolute positioning G1 X200 F6000 ; center X position on build platform G1 Y200 F6000 ; center Y position on build platform G91 ; relative positioning ;G1 H1 Z-205 F1800 ; move Z down until the endstop is triggered G30 ; Do a single probe to home our Z axis G90 ; Make sure we are in absolute mode G1 Z10 F6000 ; Rapidly move the Z axis to Z=10.
bed.g
; bed.g ; called to perform automatic bed compensation via G32 ; Note: G28 Homes ALL axises ; Note: G29 Does a billion probes for mapping a bed mesh compensation. A M561 to wipe priors should be done before G29 ; Note: G32 Does a Z axis tramming only via directly invoking the macro "bed.g" ;M561 ; clears any bed transform ;G29 ; probe the bed and enable compensation G28 ; home G30 P0 X20 Y20 Z-99999 ; probe near a leadscrew G30 P1 X20 Y380 Z-99999 ; probe near a leadscrew G30 P2 X380 Y380 Z-99999 ; probe near a leadscrew G30 P3 X380 Y20 Z-99999 S4 ; probe near a leadscrew and calibrate 4 motors
No mesh.g
-
Order dependence
M584 must come earlier in config.g than any M350 and M906 commands. If it creates new axes, it must also be earlier than any M92, M201, M203, M208, M350, M566, M574, M667 and M669 commands.https://duet3d.dozuki.com/Wiki/M584
M584 X0.0 Y0.1 Z0.2 E1.1 ; set drive mapping M350 X16 Y16 Z16 E16 I1 ; configure microstepping with interpolation M92 X80.00 Y80.00 Z400.00 E727.00 ; set steps per mm M566 X2000 Y2000 Z602.65 E250 ; set maximum instantaneous speed changes (mm/min) M203 X20000 Y20000 Z1500 E3200 ; set maximum speeds (mm/min) M201 X1500 Y1500 Z500 E3200 ; set accelerations (mm/s^2) M906 X1200 Y1200 Z1200 E420 I60 ; set motor currents (mA) and motor idle factor in per cent M84 S60 ; Set idle timeout ; Multiple Z motors M584 Z0.2:0.3:0.4:0.5 ; assigning all the Z drives
Mapping the Z motors after the axis settings have been applied might be a problem, but not sure that's a smoking gun.
Do the order of your points in M671 match the order of the drives in M584?
If you send M98 P"config.g" do you get any errors?
-
@phaedrux Hi.
I corrected the M584 - M669 precedence issue : No obvious change.I also put the mapping of the 4 Z motors into the same M584 statement to bury any smoking gun.
M584 X0.0 Y0.1 Z0.2:0.3:0.4:0.5 E1.1 ; set drive mapping (combining all assignments in one line)
Also no change.
I had the entire heavy printer propped up at an angle and thought maybe that was causing some frame torque issue. I dropped it down level and closed up everything.
No change.
I then ran G32 which runs in turn runs bed.g which looks like this:
M561 ; clears any bed transform G30 P0 X20 Y20 Z-99999 ; probe (-99999) near a leadscrew X0,Y0 G30 P1 X20 Y380 Z-99999 ; probe near a leadscrew X0,Y400 G30 P2 X380 Y380 Z-99999 ; probe near a leadscrew X400,Y400 G30 P3 X380 Y20 Z-99999 S4 ; probe near a leadscrew X400,Y0 and calibrate 4 Z axis motors (Tram them)
Pretty sure the drives are in the same order of points used in M671.
I've then run G32 multiple times right after each other.
Recall my 4 Z motors are ordered this way:
; --- drive map --- ; _______ ; | 3 | 4 | ; | ----- | ; | 2 | 5 | ; ------- ; front
Here's what three tests in a row look like!
The third faulted refusing to do a tram calculation because the error exceeded my 5mm limit. (Whole sequence has been repeated several times with a fault eventually after 3 or 4 trammings.); --- drive map --- BACK ; ----------------- ; pass 1 | -2.429 | -0.012 | ; pass 2 | -4.943 | 0.010 | ; pass 3 | -7.348 | 0.019 | ; | ------ | ------ | ; pass 1 | 0.038 | 2.486 | ; pass 2 | 0.531 | 2.427 | ; pass 3 | 0.387 | 0.268 | ; ----------------- ; FRONT
I'm going crazy here after days of these results.
Any Ideas?
-
Try changing the probe point order?
Looking a the the examples for bed levelling, the three motor one does not use the same probe order as motor / screw order??
https://duet3d.dozuki.com/Wiki/Bed_levelling_using_multiple_independent_Z_motorsIt may be using left-right and back-front order, though its difficult to be sure with only three points.
eg. possibly
G30 P0 X20 Y380 Z-99999 ; probe X0,Y400 - Left Back G30 P1 X380 Y380 Z-99999 ; probe X400,Y400 - Right Back G30 P2 X20 Y20 Z-99999 ; probe X0,Y0 - Left Front G30 P3 X380 Y20 Z-99999 S4 ; probe X400,Y0 - Right Front & cal.
-
@rjenkinsgb Robert!! You're correct. That example is crazy. Using LR then RR the Fcenter while having defined them in LR/FC/RR order.
I agree it seems like there is a mismatch on my machine as each time the correction gets worse with the LR tower. Unhelpfully not much guidance anywhere on how to figure out which two are backwards.
Clearly my LR is goes haywire fast. The next worst I guess is my FR. But what does this mean? That the LR and FR are backwards or the LF and RR? Ugh.
I swapped 3 and 5 (LR and RF). The error between subsequent passes grew on the the LR and RF values.
LR pass 1 1.023
LR pass 2 2.233RF pass 1 -1.214
RF pass 2 -2.210Instead swapped LF with RR.
Very bad.Then instead swapped LR with LF....
The LR stepper started doing something odd. Either losing steps or adding steps. It aborted with a "too large error", (more than 5mm). -
@kcress
Have you tried the exact sequence I suggested? I'm not sure from the various swaps you mention.. -
@rjenkinsgb the probe point order is irrelevant. The method simply stores all the points and puts a plane through them to work out the offsets.
You can have more probe points than you have motors too (I probe 6 points for my 3 z motors), and it will do a least squares fit for the plane.@kcress have you tried using S3 levelling? S4 will try and warp the bed out of plane (so will try and bend your build plate), but S3 will only make in-plane adjustments. That might help narrow down where your issue lies?
-
@kcress said in Mesh Confusion:
The third faulted refusing to do a tram calculation because the error exceeded my 5mm limit. (Whole sequence has been repeated several times with a fault eventually after 3 or 4 trammings.)
Then something is definitely wrong if it's getting worse after each run. The order of the points in bed.g don't matter, but the order of the points in M671 must match the order of the motors in M584.
You must use the M671 command to define the X and Y coordinates of the leadscrews. The M671 command must come after the M584 command and must specify the same number of X and Y coordinates as the number of motors assigned to the Z axis in the M584 command; and these coordinates must be in the same order as the driver numbers of the associated motors in the M584 command. The M671 command must also come after any M667 or M669 command.
https://duet3d.dozuki.com/Wiki/Bed_levelling_using_multiple_independent_Z_motors
If you error is increasing after repeated runs of bed.g then I think your error lies in the order of M671.
-
@Robert: Yes tried your order. No obvious change.
Tried several different orders all with worse, even E-Stop pounding worse.@engikeneer: Have not tries S3 since my bed is 3/8" plate aluminum. Only the gantry is Z on all four corners.
Also this makes me hesitate:
NOTE: From RepRapFirmware version 1.09 to 3.01-RC4, the number of factors may be 3, 4 or 5 when doing old-style auto bed compensation on a Cartesian or CoreXY printer. This form of bed compensation has been removed in RRF 3.01-RC5 and later.@phaedrux To be clear, the values in M671 are supposed to be the physical mm locations of the actual gantry posts regardless of the head's ability to never make it to those points right?
Please check me here. Given the Z drives are 2,3,4,5 exactly as depicted in the square below. And, are in numeric order. Front LEFT is (0,0) Isn't my M671 correct?
M671 X-60.0:-60.0:460:460 Y-30.0:470.0:470.0:-30.0 S20 ; Z belts at 4 corners where the slides are ; --- drive map --- ; _______ ; | 3 | 4 | ; | ----- | ; | 2 | 5 | ; ------- ; FRONT
How can I drive the z motors independently of everything else to test their channel # and positions?
I made a MACRO to probe the 4 corners and only report the 4 values. The numbers repeat within a few 0.001mm.
-
@kcress Im not sure on that Wiki quote, I think that's referring to an old version of mesh compensation via G30 commands, but might be wrong. I know it definitely works in both 2.05.1 and 3.3.0 with S3 on my machines!
I also think I may have been wrong on the S3... from the independent bed levelling page:The value of the S parameter on the final G30 command in bed.g must equal the number of Z motors
If you haven't already, you can run with S-1 and it will just report the measurements, not make the changes
-
@engikeneer Hi!
That's right the S now has to equal the number of Z motors. Thanks for reminding me.As I mentioned the MACRO I whipped up? That's the G30 with S-1. Works well!
-
Well no one could tell me how to just drive a specific stepper output...
So, I decided to simply de-allocate three of the Z motors at a time in the M584 line of the config.g and do a Z move of the remaining one after an M564 H0 to allow un-homed movements. SMALL moves!
Doing that I could see which of the 4 Z motors was actually moving as compared to which one I thought should be moving.
Turned out instead of:
; --- drive map --- ; _______ ; | 3 | 4 | ; | ----- | ; | 2 | 5 | ; ------- ; FRONT
I actually had:
; --- drive map --- ; _______ ; | 5 | 4 | ; | ----- | ; | 2 | 3 | ; ------- ; FRONT
Which utterly screwed up everything causing the incrementing LR corner error and decrementing RF corner error with each G32 command. The errors even accelerated as with each subsequent G32 the error was greater demanding greater yet miscorrections
I'd traced all the cables manually but accidentally swapped those two even writing which Z motor they were(n't) on the cables.
I swapped those two on the 6HC and then ran HOME ALL and then consecutive G32s.
12/28/2021, 3:06:34 AM G32
Leadscrew adjustments made: -0.757 -0.154 1.087 -1.036, points used 4, (mean, deviation) before (0.024, 0.619) after (-0.000, 0.000)12/28/2021, 3:07:28 AM G32
Leadscrew adjustments made: 0.099 0.146 0.462 0.296, points used 4, (mean, deviation) before (0.286, 0.104) after (-0.000, 0.000)12/28/2021, 3:08:30 AM G32
Leadscrew adjustments made: 0.015 0.026 0.055 0.039, points used 4, (mean, deviation) before (0.038, 0.011) after (-0.000, 0.000)12/28/2021, 3:21:13 AM G32
Leadscrew adjustments made: 0.007 0.005 0.006 0.006, points used 4, (mean, deviation) before (0.006, 0.001) after (0.000, 0.000)Dang, what a struggle that was.
I do like the results! I appreciate only 0.0003" errors!!So the lesson with 4 Z motors is this:
If, with repeated G32 (bed.g) runs any one corner increases its error positively while any other corner simultaneously has an increasingly negative error electrically swap those two corner's Z motors.
-
-