Auto leveling with two independent Z steppers?
-
I think the P parameter in your M558 command is wrong (Depending on the firmware you are on of course)
I think it should read P1 instead of P5
M558 P5 H5 A20 F300 T9000 I0 R0.5 ; Set Z probe type mini ir sensor (THIS IS YOURS)
M558 P1 F120 H5 T6000 ; set Z probe type to unmodulated and the dive height + speeds (THIS IS MINE)
As if you follow David's own blog instructions he lists the probe type as P1 see Here
Testing and commissioning the board
Testing with Duet electronics
In your config.g file, use probe type P1 in your M558 command and trigger threshold P500 in your G31 command.
Start with the hot end and sensor some distance above the bed. Power up the Duet using USB power only. About 4 seconds after power is applied, the LED on the sensor should flash four times, indicating that the board has started in analog output mode. If it does not flash, check the power connections to the board.
Connect to the Duet from a PC using the web interface. On the Control page you can see a continuous readout of the Z probe reading.
Send M558 P1 to the Duet, then send G31 P500 Z1.0.
Move a suitable target (e.g. white paper or glass) up underneath the sensor. Check that you get the following readings:
With the sensor a long way above any surface, the reading should be close to zero.
With the sensor close to a surface but slightly further away than the trigger height, the reading should be about 465.
With the sensor slightly closer to a surface, the reading should be about 535 and the red LED on the sensor board should illuminate.
If you place a surface right up against the sensor board, then the reading may drop to near zero again. This is normal.
If you see a reading of around 1000, or if the LED flashes rapidly, this means that there is too much ambient IR for the sensor to function correctly. This normally happens only when direct bright sunlight is reflected from the bed into the sensor, or when you place a highly reflective surface below the sensor such as aluminium foil.
If you get the expected readings, then you can apply 12V power and continue with commissioning. If not, check your wiring.With 12V power applied, send M558 P1 followed by G31 P500 Z1.0 to the Duet again. Note: if your printer does not use the Z probe to home any axes, you also need to add parameters X0 Z0 to the M558 P1 command.
To calibrate the sensor for Z homing and bed probing, home X and Y, then position the head over the centre of the bed. With the nozzle at operating temperature, lower the head so that it is just touching the bed or just gripping a sheet of paper, then send G92 Z0 to define that position as Z=0. Raise the head 5mm and remove the paper. Then send command G30 S-1 to probe the bed at that point without adjusting the Z height setting. Read off the Z height in the “Head Position” box in Duet Web Control, or from the Z coordinate shown on the Control page of Panel Due, or send M114 to retrieve the head position if using a USB host program on a PC. It should be in the range 0.5 to 2.5mm. Use that value for the Z parameter in your G31 command in config.g. Please note:
The S-1 parameter may not be supported in the official RepRap Firmware release. It is supported in my fork and dcnewman’s fork.
Always use a P value of 500. When the probe is triggered, the Z probe reading will be about 535. When it is slightly higher than the trigger height, the reading will be about 465. With a P value of 500, when the Duet sees the reading of about 465, it knows it is getting close to target height and it will slow down the Z motor.
If you are using my (dc42) fork of RepRap Firmware, then the G31 command in config.g must come after the M558 P1 command. This is because the firmware supports different G31 values for different sensor types.
After turning your printer on, do not perform any operation that uses the sensor (e.g. X homing on some printers) for 5 seconds, until after the LED has done its 4 flashes.
-
It needs to be P5 I have a prusa pinda probe. The ir sensor and the powdercoated sheet do not work. So I changed the probe.The issue is I guess in my M671 code. I see in examples here the first number is negative. I assume that is becose the screw is outside the limit of the machine?
-
Then you need to change the description at the end of the M558 command as YOU have it listed as an IR sensor.
-
If X ZERO is at the Low end of the X axis (i.e the left side of the bed) and the lead screw is further to the left of that then the FIRST number needs to be a negative from the the ZERO point. this is MY code that IS WORKING.
M671 X-40:440 Y206:206 S2 ; Lead screw positions at right and left of the X axis
-
thanks, you use this on a blv cube?
-
Ok, independent leveling works, 1 problem left after doing all this is the fact that the printer does not recognized the whole bed size? After G32 it does z level dance twice and reports back level correction. After that it goes wrong it homes not in the center of the bed anymore. But in the back left. And the mesh leven happens in that left back part. During mesh leven it errors telling certain points could not be reached.
-
I use the basis for this on many printers.
You need to play with your axis maxima & minima and define your grid to where the PROBE can reach NOT to where the nozzle can reach.
-
@Caveman said in Auto leveling with two independent Z steppers?:
Ok, independent leveling works, 1 problem left after doing all this is the fact that the printer does not recognized the whole bed size? After G32 it does z level dance twice and reports back level correction. After that it goes wrong it homes not in the center of the bed anymore. But in the back left. And the mesh leven happens in that left back part. During mesh leven it errors telling certain points could not be reached.
Perhaps best to start a new thread. Include your entire config.g and homing files.
-
@Phaedrux, I think that the dual Z leveling procedure requires also an additional Z homing, after the leveling.
If I do center point Z homing with bltouch and then run a mesh probing, the mesh is as expected. If instead I do center z homing, then dual Z leveling (this is a new step) and then mesh probing, the mesh is sometimes elevated 0.2 - 0.3mm, as the dual z leveling introduced Z offset. A second Z homing at the center fixes that.
Does this make sense?
-
Yes that makes sense. When you correct for tilt the z height has changed.
-
@Phaedrux said in Auto leveling with two independent Z steppers?:
Yes that makes sense. When you correct for tilt the z height has changed.
But wait, surely David took this into account when writing the firmware? Logically when the firmware homes all axis it stores that data (including the Z offset at the centre of the bed) then it carries out the requested "leveling" of the X gantry along the X axis which is now being probed at the pre determined three points (up until the point it starts probing the mesh)
Surely logic would dictate that as the firmware already knows where it is in space (because it has homed) and now has a virtual picture of those three points along the X axis and the fact that those three point are going to be of an already fixed (level) height (unless the bed has been physically moved)
And Because we have already set the dive height number of where any probe triggers for example in the centre the probe triggers when the nozzle is 0.041mm from the bed, then when the probe goes to the first left probe point, it is still going to trigger when the nozzle is 0.041mm from the bed because of how the nozzle is physically mounted.
To me it must get the difference in knowing the trigger point in the centre, then when the height it lifted up then it compares how much it had to drop down (plus or minus) at the SAME trigger distance above the bed, and then it does exactly the same at the second leveling point along the X axis and compares all Three measurements and extrapolates the difference, and adjusts itself accordingly, I don't think that physically the z offset in the centre of the bed is physically going to change due to "leveling" along the X axis.
Is it not going to plot along all THREE points "joining the dots" and follow the terrain of the bed between point 1, the centre (which is the home/datum) and point 2 instead of looking at it as a straight line between points 1 & 2 ?
Of course if its its not like that maybe @DC42 can please explain how it does take its measurements and how the "levelling" effects homing.
-
The leadscrews are adjusted to try to make the height errors at the points probed in bed.g as small as possible. That's not the same as setting zero height error at bed centre, which is what you normally do when homing Z using a Z probe.
-
@dc42 said in Auto leveling with two independent Z steppers?:
The leadscrews are adjusted to try to make the height errors at the points probed in bed.g as small as possible
This is consistent with the dictionary. 'leveling' is merely making something horizontal. I was thinking of it as dual z homing and hence my initial confusion.
I think it worth clarifying in a few places in the documentation that the required sequence is home/level/home, and then an optional mesh.
When I run just home/level/mesh, I got a warning about Z offset.