Dual Z motors and compensation programing questions
-
config.g
; Configuration file for Duet WiFi (firmware version 3) ; executed by the firmware on start-up ; ; generated by RepRapFirmware Configuration Tool v3.2.2 on Fri Jan 22 2021 11:13:01 GMT-0600 (Central Standard Time) ; General preferences G90 ; send absolute coordinates... M83 ; ...but relative extruder moves M550 P"Caymas 3D Printer" ; set printer name ; Network M552 S1 ; enable network M586 P0 S1 ; enable HTTP M586 P1 S0 ; disable FTP M586 P2 S0 ; disable Telnet ; Drives M569 P8 R1 T2.5:2.5:5:5 S0 ; physical drive 8 goes forwards M569 P6 R1 T2.5:2.5:5:5 S1 ; physical drive 6 goes forwards M569 P2 S0 ; physical drive 2 goes forwards M569 P5 R1 T2.5:2.5:5:5 S0 ; physical drive 5 goes forwards M569 P3 S0 ; physical drive 3 goes forwards M584 X6 Y8 Z2:3 E5 ; set drive mapping M671 X-10.0:1200.0 Y450.5:450.5 ; Set z motor relative locations M350 X16 Y16 Z16 E16 I1 ; configure microstepping with interpolation M92 X320.00 Y320.00 Z640.00 E80 ; set steps per mm M566 X200.00 Y200.00 Z12.00 E120.00 ; set maximum instantaneous speed changes (mm/min) M203 X3000.00 Y3000.00 Z340.00 E4000.00 ; set maximum speeds (mm/min) M201 X200.00 Y200.00 Z20.00 E250.00 ; set accelerations (mm/s^2) M906 X2000 Y2000 Z2800 E800 I30 ; set motor currents (mA) and motor idle factor in per cent M84 S30 ; Set idle timeout ; Axis Limits M208 X0 Y0 Z0 S1 ; set axis minima M208 X1170 Y1100 Z1100 S0 ; set axis maxima ; Endstops M574 X1 S1 P"!xstop" ; configure active-low endstop for low end on X via pin xstop M574 Y1 S1 P"!ystop" ; configure active-low endstop for low end on Y via pin ystop M574 Z1 S2 ; configure Z-probe endstop for low end on Z ; Z-Probe M558 P1 C"zprobe.in+zprobe.mod" H5 F240 T3600 ; set Z probe type to unmodulated and the dive height + speeds G31 P500 X0 Y-69.85 Z1.8 ; set Z probe trigger value, offset and trigger height M557 X100:1170 Y100:1100 S100 ; define mesh grid ; Heaters M308 S0 P"spi.cs2" Y"thermocouple-max31856" ; configure sensor 0 as thermocouple on pin bedtemp M950 H0 C"bedheat" T0 ; create bed heater output on bedheat and map it to sensor 0 M307 H0 B0 S1.00 ; disable bang-bang mode for the bed heater and set PWM limit M140 H0 ; map heated bed to heater 0 M303 H0 S60 ;Tune for 60C M307 H0 R0.168 C358.6 D7.17 S1.00 V24.2 M143 H0 S120 ; set temperature limit for heater 0 to 120C M308 S1 P"spi.cs1" Y"thermocouple-max31856" ; configure sensor 1 as thermistor on pin e0temp M950 H1 C"e0heat" T1 ; create nozzle heater output on e0heat and map it to sensor 1 M307 H1 B0 S1.00 ; disable bang-bang mode for heater and set PWM limit M303 H1 S200 ;Tune for 200c M307 H1 R2.211 C192.4 D8.94 S1.00 V24.2 M143 H1 S320 ; set temperature limit for heater 1 to 320C M500 ; Fans M950 F0 C"fan0" Q500 ; create fan 0 on pin fan0 and set its frequency M106 P0 S0 H-1 ; set fan 0 value. Thermostatic control is turned off M950 F1 C"fan1" Q500 ; create fan 1 on pin fan1 and set its frequency M106 P1 S1 H1 T45 ; set fan 1 value. Thermostatic control is turned on ; Tools M563 P0 D0 H1 F0 ; 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 ; Custom settings are not defined ; Miscellaneous M575 P1 S1 B57600 ; enable support for PanelDue M911 S10 R11 P"M913 X0 Y0 G91 M83 G1 Z3 E-5 F1000" ; set voltage thresholds and actions to run on power loss M501
homeALL.g
; homeall.g ; called to home all axes ; ; generated by RepRapFirmware Configuration Tool v3.2.2 on Fri Jan 22 2021 11:13:01 GMT-0600 (Central Standard Time) G91 ; relative positioning G1 H2 Z5 F3600 ; lift Z relative to current position G1 H1 X-1105 Y-1105 F1800 ; move quickly to X and Y axis endstops and stop there (first pass) G1 H2 X5 Y5 F3600 ; go back a few mm G1 H1 X-1105 Y-1105 F360 ; move slowly to X and Y axis endstops once more (second pass) G90 ; absolute positioning G1 X200 Y450 F3600 ; go to first bed probe point and home Z G30 ; home Z by probing the bed ; Uncomment the following lines to lift Z after probing ;G91 ; relative positioning ;G1 Z5 F60 ; lift Z relative to current position ;G90 ; absolute positioning
homeX.g
; homex.g ; called to home the X axis ; ; generated by RepRapFirmware Configuration Tool v3.2.2 on Fri Jan 22 2021 11:13:01 GMT-0600 (Central Standard Time) G91 ; relative positioning G1 H2 Z5 F3600 ; lift Z relative to current position G1 H1 X-1105 F1800 ; move quickly to X axis endstop and stop there (first pass) G1 H2 X20 F3600 ; go back a few mm G1 H1 X-1105 F360 ; move slowly to X axis endstop once more (second pass) G1 H2 Z-5 F3600 ; lower Z again G90 ; absolute positioning
homeY.g
; homey.g ; called to home the Y axis ; ; generated by RepRapFirmware Configuration Tool v3.2.2 on Fri Jan 22 2021 11:13:01 GMT-0600 (Central Standard Time) G91 ; relative positioning G1 H2 Z5 F3600 ; lift Z relative to current position G1 H1 Y-1105 F1800 ; move quickly to Y axis endstop and stop there (first pass) G1 H2 Y20 F3600 ; go back a few mm G1 H1 Y-1105 F360 ; move slowly to Y axis endstop once more (second pass) G1 H2 Z-5 F3600 ; lower Z again G90 ; absolute positioning
homeZ.g
; homez.g ; called to home the Z axis ; ; generated by RepRapFirmware Configuration Tool v3.2.2 on Fri Jan 22 2021 11:13:01 GMT-0600 (Central Standard Time) G91 ; relative positioning G1 H2 Z5 F3600 ; lift Z relative to current position G90 ; absolute positioning G1 X200 Y450 F3600 ; 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 Z5 F60 ; lift Z relative to current position ;G90 ; absolute positioning
bed.g
; bed.g ; called to perform automatic bed compensation via G32 ; ; generated by RepRapFirmware Configuration Tool v3.2.2 on Fri Jan 22 2021 11:13:01 GMT-0600 (Central Standard Time) M561 ; clear any bed transform G29 ; probe the bed and enable compensation
-
Great.
In your bed.g file you have:
M561 G29
This is not correct for bed leveling using multiple Z steppers.
The command to start bed leveling is G32 and it invokes bed.g.
So bed.g must contain the commands needed for bed leveling - not the commands you have for creating a height map.
Here is my bed.g on my printer which has 3 Z steppers:
; set positions of ball studs for auto-leveling (S is max allowed adjustment) M671 X-180:0:180 Y-65:130:-65 S3 ; level the bed G30 P0 X-145 Y-65 Z-99999 ; probe near ball stud #1 G30 P1 X0 Y100 Z-99999 ; probe near ball stud #2 G30 P2 X145 Y-65 Z-99999 S3 ; probe near ball stud #3 and perform leveling ; set the Z=0 datum which may have changed due to bed leveling ; step 1 - move probe to center of bed G1 X{-sensors.probes[0].offsets[0]}, Y{-sensors.probes[0].offsets[1]}, F6000 ; step 2 - do single probe which sets Z to trigger height of Z probe G30
Does that make sense to you?
I will be glad to explain but I just followed the documentation for auto bed leveling.
Frederick
-
@fcwilt Okay, I will update my bed.g, do I need to add anything to the other home files? I am just not sure what uses the bed.g file/ what calls for it.
-
@Tpmoses said in Dual Z motors and compensation programing questions:
@fcwilt Okay, I will update my bed.g, do I need to add anything to the other home files? I am just not sure what uses the bed.g file/ what calls for it.
The homing files should not affect this process in any way.
The bed.g file is invoked by the command G32 which is the command used for both manual and automatic bed leveling.
Here is the DWC pull-down menu showing the item True Bed Leveling (G32).
Selecting that item will run bed.g so bed.g must have the commands needed to perform bed leveling.
Frederick
-
@fcwilt Okay, I updated my bed.g. It runs the program, and it probes at both leadscrews. The only Issue I can ee now is that it doesn't adjust the z motor to make the gantry level now. any suggestions?
T
-
When I run G32 I get this in the console
G32
Error: Some computed corrections exceed configured limit of 1.00mm: -0.669 -2.140 -
@Tpmoses said in Dual Z motors and compensation programing questions:
@fcwilt Okay, I updated my bed.g. It runs the program, and it probes at both leadscrews. The only Issue I can ee now is that it doesn't adjust the z motor to make the gantry level now. any suggestions?
T
Hi,
Post your updated bed.g file and let's see what it looks like.
About the message: increase the S parameter in the M671 command.
Frederick
-
Here is my new Bed.g,
; bed.g ; called to perform automatic bed compensation via G32 ; ; generated by RepRapFirmware Configuration Tool v3.2.2 on Fri Jan 22 2021 11:13:01 GMT-0600 (Central Standard Time) M561 ; clear any bed transform G28 ; home G30 P0 X0 Y450 Z-99999 ; probe near a leadscrew, half way along Y axis G30 P1 X1170 Y450 Z-99999 S2 ; probe near a leadscrew and calibrate 2 motors
The M671 command is in my config.g like the guide had said, however I didn't have an S value there. I will add that and see what it does.
-
As well as the probe offset is in config.g
-
@Tpmoses said in Dual Z motors and compensation programing questions:
The M671 command is in my config.g like the guide had said, however I didn't have an S value there. I will add that and see what it does.
I don't know why that command is put into config.g.
It's part of bed leveling so I put it into bed.g along with all the other bed leveling commands so I can see at a glance all relevant values.
Also there is no G30 in the bed.g file so you should add this to your bed.g file.
; set the Z=0 datum which may have changed due to bed leveling ; -- step 1 - move probe to center of bed G1 X{-sensors.probes[0].offsets[0]}, Y{-sensors.probes[0].offsets[1]}, F6000 ; -- step 2 - do single probe which sets Z to trigger height of Z probe G30```
-
It looks like the S value in the M671 was the issue. I didn't have it specified, so it defaulted too small. I'm not sure why it is in config.g, that is just where the guide i was using Bed levelling using multiple independent Z motors said to put it.
I will add that secondary homing to bed.g and go from there. Thank you for your help!
Thanks,
T -
@Tpmoses said in Dual Z motors and compensation programing questions:
I'm not sure why it is in config.g, that is just where the guide i was using [Bed levelling using multiple independent Z motors]>
Several things get tossed into config.g that I just happen to think belong elsewhere, like M671. It is part of bed leveling so why not put it into bed.g along with all the other bed leveling commands.
It's not that having them in config.g is wrong, they will work there just fine, it's just not the way my mind works.
I will add that secondary homing to bed.g and go from there. Thank you for your help!
The commands I mentioned to add to bed.g are not homing commands, they are commands to set the Z=0 datum.
Bed leveling can change that value so it is safest to reset it so it is correct after bed.g is complete.
Setting the Z=0 datum needs to be done at other times so not being in bed.g doesn't mean things won't work but why not set it there just to be safe.
Frederick
-
@Tpmoses just to contradict @fcwilt here... I just run homeZ (G28 Z) at the end of my bed.g. in my case my homeZ just uses a z probe at a set point, so it means I can make sure I always probe the same point to reset the Z datum. If you use an endstop in your homeZ (e.g. in a delta printer), then this won't work and you'll have to use fcwilt's method (or something similar).
-
@engikeneer said in Dual Z motors and compensation programing questions:
@Tpmoses just to contradict @fcwilt here... I just run homeZ (G28 Z) at the end of my bed.g. in my case my homeZ just uses a z probe at a set point, so it means I can make sure I always probe the same point to reset the Z datum. If you use an endstop in your homeZ (e.g. in a delta printer), then this won't work and you'll have to use fcwilt's method (or something similar).
Good point.
While I have a Z probe I also always install a Z end stop sensor, one per Z stepper.
The normal probing speed for one of my probes is 300 or less - depending on type of probe.
Homing using the end stop sensors is much quicker since the normal homing speed is 1200 or more.
My apologies for failing to mention this.
I should also point out that the formula I posted for probing the center of the bed...
G1 X{0 - sensors.probes[0].offsets[0]}, Y{0 - sensors.probes[0].offsets[1]}, F6000
...is based on my printers co-ordinates for bed center - which are X=0 and Y=0
The formula will work regardless if you change each 0 before the minus sign to the correct value for your bed center.
I only showed the formula there by way of demonstration. I don't actually do that but wanted to keep things simple. I actually have a macro that I call to set the Z=0 datum as needed and it does use the formula. But since I always call the macro I always use the same XY co-ordinates.
Again my apologies - I keep forgetting that not everyone uses 0,0 as bed center.
Thanks.
Frederick